I have a pickled file with 2 arrays. The first array is a floating point array, the second is a UInt8 array. On one machine pickle.load(F)
twice loads both arrays, while on the other it does not. Instead I get
ERROR: PyError ($(Expr(:escape, :(ccall(#= ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'OSError'>
OSError('MethodError: no method matching pybytes(::Int64)\nClosest candidates are:\n pybytes(!Matched::Union{String, DenseVector{UInt8}}) at ~/.julia/packages/PyCall/BD546/src/serialize.jl:27\nStacktrace:\n [1] (::PyCall.var"##readinto#274#95")(self::PyObject, b::Vector{UInt8})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/io.jl:23\n [2] invokelatest(::Any, ::Any, ::Vararg{Any, N} where N; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})\n @ Base ./essentials.jl:708\n [3] invokelatest(::Any, ::Any, ::Vararg{Any, N} where N)\n @ Base ./essentials.jl:706\n [4] _pyjlwrap_call(f::Function, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/callback.jl:32\n [5] pyjlwrap_call(self_::Ptr{PyCall.PyObject_struct}, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/callback.jl:44\n [6] macro expansion\n @ ~/.julia/packages/PyCall/BD546/src/exception.jl:95 [inlined]\n [7] #107\n @ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 [inlined]\n [8] disable_sigint\n @ ./c.jl:458 [inlined]\n [9] __pycall!\n @ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:42 [inlined]\n [10] _pycall!(ret::PyObject, o::PyObject, args::Tuple{IOStream}, nargs::Int64, kw::Ptr{Nothing})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:29\n [11] _pycall!(ret::PyObject, o::PyObject, args::Tuple{IOStream}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:11\n [12] (::PyObject)(args::IOStream; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})\n @ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86\n [13] (::PyObject)(args::IOStream)\n @ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86\n [14] top-level scope\n @ REPL[8]:1\n [15] eval\n @ ./boot.jl:360 [inlined]\n [16] eval_user_input(ast::Any, backend::REPL.REPLBackend)\n @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:139\n [17] repl_backend_loop(backend::REPL.REPLBackend)\n @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:200\n [18] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)\n @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:185\n [19] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)\n @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:317\n [20] run_repl(repl::REPL.AbstractREPL, consumer::Any)\n @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:305\n [21] (::Base.var"#874#876"{Bool, Bool, Bool})(REPL::Module)\n @ Base ./client.jl:387\n [22] #invokelatest#2\n @ ./essentials.jl:708 [inlined]\n [23] invokelatest\n @ ./essentials.jl:706 [inlined]\n [24] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)\n @ Base ./client.jl:372\n [25] exec_options(opts::Base.JLOptions)\n @ Base ./client.jl:302\n [26] _start()\n @ Base ./client.jl:485')
File "PyCall", line 1, in <lambda>
Stacktrace:
[1] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:62 [inlined]
[2] pyerr_check
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:66 [inlined]
[3] _handle_error(msg::String)
@ PyCall ~/.julia/packages/PyCall/BD546/src/exception.jl:83
[4] macro expansion
@ ~/.julia/packages/PyCall/BD546/src/exception.jl:97 [inlined]
[5] #107
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 [inlined]
[6] disable_sigint
@ ./c.jl:458 [inlined]
[7] __pycall!
@ ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:42 [inlined]
[8] _pycall!(ret::PyObject, o::PyObject, args::Tuple{IOStream}, nargs::Int64, kw::Ptr{Nothing})
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:29
[9] _pycall!(ret::PyObject, o::PyObject, args::Tuple{IOStream}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:11
[10] (::PyObject)(args::IOStream; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86
[11] (::PyObject)(args::IOStream)
@ PyCall ~/.julia/packages/PyCall/BD546/src/pyfncall.jl:86
[12] top-level scope
@ REPL[8]:1
Both systems are running PyCall 1.92.3, python 3.9.4. On both systems, when I invoke python I can read both arrays. There are some older posts discussing a pybytes
error, but none of those remedies have worked for me. I am at a loss what to change.