Skip to content

Commit 80b5c15

Browse files
author
Christopher Rowley
committed
Merge remote-tracking branch 'origin/main' into 774-v2
2 parents 715c859 + b4cd8cf commit 80b5c15

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Run tests
6464
uses: julia-actions/julia-runtest@v1
6565
env:
66-
JULIA_DEBUG: PythonCall
66+
JULIA_DEBUG: ${{ runner.debug == '1' && 'PythonCall' || '' }}
6767
JULIA_NUM_THREADS: '2'
6868
PYTHON: ${{ steps.setup-python.outputs.python-path }}
6969
JULIA_PYTHONCALL_EXE: ${{ case(matrix.pythonexe == 'python', steps.setup-python.outputs.python-path, matrix.pythonexe) }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
* Added option `lib` to JuliaCall. Setting this will skip the discovery subprocess.
5+
* Bug fixes.
56

67
## 0.9.34 (2026-05-18)
78
* Bug fixes.

src/Wrap/PyArray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ end
531531
function PyArraySource_Buffer(x::Py)
532532
memview = pybuiltins.memoryview(x)
533533
buf = C.UnsafePtr(C.PyMemoryView_GET_BUFFER(memview))
534+
buf.suboffsets[] == C_NULL ||
535+
error("PyArray does not support buffers with non-trivial suboffsets (PIL-style indirect layout)")
534536
PyArraySource_Buffer(x, memview, buf)
535537
end
536538

test/Wrap.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@
8989
@test strides(y) == strides(y2)
9090
@test y == y2
9191
end
92+
@testset "reject suboffsets (#775)" begin
93+
tb = pyimport("_testbuffer")
94+
nd = tb.ndarray(
95+
pylist([1, 2, 3, 4, 5, 6]),
96+
shape = pylist([2, 3]),
97+
format = "i",
98+
flags = tb.ND_PIL | tb.ND_WRITABLE,
99+
)
100+
@test_throws Exception PyArray(nd; array = false, buffer = true)
101+
end
92102
end
93103

94104
@testitem "PyDict" begin

0 commit comments

Comments
 (0)