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
julia> bad =Dict{Symbol,Any}(:wake_after_sleep_onset=>0, :wake_after_sleep_onset_percentage=>1)
Dict{Symbol,Any} with 2 entries::wake_after_sleep_onset=>0:wake_after_sleep_onset_percentage=>1
julia> io =IOBuffer();
julia>pack(io, bad)
julia>seekstart(io);
julia>unpack(io, Dict{Symbol,Any})
Dict{Symbol,Any} with 2 entries::wake_after_sleep_onset=>0x00:wake_after_sleep=>0x5f
The keys are truncated and the values are wrong. Also note that the value assigned to the key :wake_after_sleep is the code point for an underscore, which would be the continuation of the key name were it completely consumed.
The problem seems to be specific to packing Symbols, as packing as String and unpacking as Symbol works fine:
julia> ok =Dict{String,Any}("wake_after_sleep_onset"=>0, "wake_after_sleep_onset_percentage"=>1)
Dict{String,Any} with 2 entries:"wake_after_sleep_onset"=>0"wake_after_sleep_onset_percentage"=>1
julia> io =IOBuffer();
julia>pack(io, ok)
julia>seekstart(io);
julia>unpack(io, Dict{Symbol,Any})
Dict{Symbol,Any} with 2 entries::wake_after_sleep_onset=>0x00:wake_after_sleep_onset_percentage=>0x01
The text was updated successfully, but these errors were encountered:
Reproducer:
The keys are truncated and the values are wrong. Also note that the value assigned to the key
:wake_after_sleep
is the code point for an underscore, which would be the continuation of the key name were it completely consumed.The problem seems to be specific to packing
Symbol
s, as packing asString
and unpacking asSymbol
works fine:The text was updated successfully, but these errors were encountered: