Skip to content

Python package works on Julia 1.11 and 1.13 but errors on 1.12 #735

@nhz2

Description

@nhz2

Affects: PythonCall

Describe the bug
I expect the following output when using imagecodecs:

using Pkg
Pkg.activate(;temp=true)
pkg"add PythonCall CondaPkg"
using CondaPkg
pkg"conda pip_add imagecodecs"
using PythonCall
imcd = pyimport("imagecodecs")
imcd.lzma_encode(UInt8[])
# Python: b'\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F\x00\x00\x00\x00\x1c\xdfD!\x1f\xb6\xf3}\x01\x00\x00\x00\x00\x04YZ'

This works on Julia 1.11.8 and Julia 1.13.0-alpha2, but on Julia 1.12.3 I get:

julia> imcd.lzma_encode(UInt8[])
ERROR: Python: LzmaError: lzma_code returned LZMA_PROG_ERROR
Python stacktrace:
 [1] imagecodecs._lzma.lzma_encode
   @ imagecodecs/_lzma.pyx:137
Stacktrace:
 [1] pythrow()
   @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/err.jl:77
 [2] errcheck
   @ ~/.julia/packages/PythonCall/83z4q/src/Core/err.jl:10 [inlined]
 [3] pycallargs(f::Py, args::Py)
   @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/builtins.jl:194
 [4] pycall(f::Py, args::Vector{UInt8}; kwargs::@Kwargs{})
   @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/builtins.jl:213
 [5] pycall
   @ ~/.julia/packages/PythonCall/83z4q/src/Core/builtins.jl:203 [inlined]
 [6] (::Py)(args::Vector{UInt8})
   @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/Py.jl:363
 [7] top-level scope
   @ REPL[8]:1

Your system

julia> versioninfo()
Julia Version 1.12.3
Commit 966d0af0fdf (2025-12-15 11:20 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver5)
  GC: Built with stock GC
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
Environment:
  JULIA_NUM_THREADS = 1

julia> Pkg.status()
Status `/tmp/jl_bFSaIh/Project.toml`
  [992eb4ea] CondaPkg v0.2.33
  [6099a3de] PythonCall v0.9.31

julia> CondaPkg.status()
CondaPkg Status /tmp/jl_bFSaIh/CondaPkg.toml
Environment
  /tmp/jl_bFSaIh/.CondaPkg/.pixi/envs/default
Pip Packages
  imagecodecs v2025.11.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions