You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using HTTP
HTTP.get("http://httpbin.org/image/png")
This displays the error:
BoundsError: attempt to access 256-element Array{Array{UInt8,1},1} at index [0]
getindex at array.jl:729 [inlined]
getindex at multidimensional.jl:458 [inlined]
write(::JSON.Writer.StringContext{JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}}, ::UInt8) at Writer.jl:123
unsafe_write at io.jl:197 [inlined]
macro expansion at gcutils.jl:87 [inlined]
write(::JSON.Writer.StringContext{JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}}, ::String) at io.jl:165
print at io.jl:167 [inlined]
show_string(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::String) at Writer.jl:198
show_json at Writer.jl:251 [inlined]
show_element(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::String) at Writer.jl:218
show_json(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Array{String,1}) at Writer.jl:293
show_pair(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Symbol, ::Array{String,1}) at Writer.jl:241
show_pair(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Pair{Any,Any}) at Writer.jl:243
show_json(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Dict{Any,Any}) at Writer.jl:271
show_pair(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Symbol, ::Dict{Any,Any}) at Writer.jl:241
show_pair(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Pair{Any,Any}) at Writer.jl:243
show_json(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Dict{Any,Any}) at Writer.jl:271
show_element(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Dict{Any,Any}) at Writer.jl:218
show_json(::JSON.Writer.CompactContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Array{Any,1}) at Writer.jl:293
#show_json#3 at Writer.jl:325 [inlined]
show_json at Writer.jl:324 [inlined]
print(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Array{Any,1}) at Writer.jl:349
#sprint#340(::Nothing, ::Int64, ::Function, ::Function, ::Array{Any,1}) at io.jl:101
sprint at io.jl:97 [inlined]
json at Writer.jl:354 [inlined]
msg(::String, ::Int64, ::Vararg{Any,N} where N) at comm.jl:125
handlemsg(::Dict{String,Any}, ::Dict{String,Any}) at comm.jl:165
(::getfield(Atom, Symbol("##19#21")){Array{Any,1}})() at task.jl:259
The text was updated successfully, but these errors were encountered:
julia> using JSON, HTTP
julia> res = HTTP.get("http://httpbin.org/image/png");
julia> sres = sprint(show, res);
julia> JSON.json(sres)
ERROR: BoundsError: attempt to access 256-element Array{Array{UInt8,1},1} at index [0]
The problem is that JSON can't handle invalid UTF8 in strings, which is somewhat unfortunate.
Details
Steps to reproduce
This displays the error:
The text was updated successfully, but these errors were encountered: