-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: MethodError: Cannot convert
an object of type NotString to an object of type String
#65
Comments
convert
an object of type NotString to an object of type String
I think I understood where it comes from
|
Thank you for the report and investigation. One simple fix could be something like that: diff --git a/src/worker.jl b/src/worker.jl
index 0aa8240..98d3d0f 100644
--- a/src/worker.jl
+++ b/src/worker.jl
@@ -77,7 +77,7 @@ function serve(server::Sockets.TCPServer)
msg_data, success = try
deserialize(io), true
catch err
- err, false
+ sprint(showerror, err) * sprint(Base.show_backtrace, catch_backtrace()), false
finally
_discard_until_boundary(io)
end Edit: your suggestion from #66 is actually better! |
After fixing it slightly myself, it turns out that the ArgumentError is quite special
Looking through the history for function pop!(a::Vector)
if isempty(a)
throw(ArgumentError("array must be non-empty"))
end Unfortunately, I couldn't find any meaningfull place inside Malt where |
are you using any custom deserialization ? |
yes, I have fixed PythonCall's serialization and deserialization to use "dill" instead of "pickle". But maybe it would also happen when using the default PythonCall serialization... I am also using plain Julia and RCall - and both do work well in Malt, only the PythonCall examples fail immediately because of whatever this underlying error is. With DistributedWorker everything works fine without problems in all three cases. |
I probably won't have time debugging this further as the Distributed backend works without problems. I guess a simple PythonCall test would show it. # Fix server Side Python to use dill instead of pickle
function PythonCall.serialize_py(s, x::Py)
if PythonCall.pyisnull(x)
PythonCall.serialize(s, nothing)
else
b = @pyconst(pyimport("dill").dumps)(x)
PythonCall.serialize(s, PythonCall.pybytes_asvector(b))
end
end
function PythonCall.deserialize_py(s)
v = PythonCall.deserialize(s)
if v === nothing
PythonCall.pynew()
else
@pyconst(pyimport("dill").loads)(pybytes(v))
end
end Maybe this is what breaks Malt, but not Distributed. |
I just run into a Malt bug.
I cannot reproduce it, but luckily the bug is obvious once seen
(to get this stacktrace I had to do quite a lot...)
Luckily it points to
Malt.jl/src/Malt.jl
Line 50 in 34e6226
which implicitly assumes that
result.value
is of typeString
, which apparently is not always the case. Some extra handling should be setup.The text was updated successfully, but these errors were encountered: