-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
make write(io, Any[...])
an error
#6466
Comments
I think the best solution here is to better separate text and binary I/O. If you want to serialize an |
This is reproducible on today's |
This has gotten slightly better since we changed One question is what Another issue is writing non-isbits arrays, or |
write(io, Any[...])
an error
Shouldn't it be an error to serialize any pointer array? |
Yes, I was using |
Also remove an unnecessary method, and generalize a `write` method for `SubArray` from `::IOStream` to `::IO`.
Also remove an unnecessary method, and generalize a `write` method for `SubArray` from `::IOStream` to `::IO`.
Also remove an unnecessary method, and generalize a `write` method for `SubArray` from `::IOStream` to `::IO`.
fix #6466, deprecate `write` on non-isbits arrays
I noticed this with IOBuffer, but it looks like IOStream, AsyncStream, and File all have the same issue. In each of their
read!{T,N}(::IO, a::Array{T,N})
methods, they assume that the number of bytes to read islength(a)*sizeof(T)
. This is not true forChar
:For IOBuffer, I think the specialization could simply be removed (albeit perhaps at a small performance loss). The others, however, are trickier — File performance is much more critical and the Async/IOStream ones need to know how many bytes to wait for.
The text was updated successfully, but these errors were encountered: