-
Notifications
You must be signed in to change notification settings - Fork 46
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
Problem with string escaping. #238
Comments
I think #108 only deals with keys, but you can try |
Hi, I confirm that I can reproduce on master. :) julia> s = "Attosecond-resolution Hong\uadOu-mandel interferometry"
"Attosecond-resolution Hong\uadOu-mandel interferometry"
julia> using YAML
julia> f = tempname()
"/tmp/jl_RSXODkvU9C"
julia> YAML.write_file(f, Dict("a"=>s))
julia> println(String(read(f)))
a: "Attosecond-resolution Hong\uadOu-mandel interferometry"
julia> YAML.load_file(f)
ERROR: while scanning a double-quoted scalar at line 1, column 3: expected escape sequence of 4 hexadecimaldigits, but found 'O' at line 1, column 30
Stacktrace:
[1] scan_flow_scalar_non_spaces(stream::YAML.TokenStream, double::Bool, start_mark::YAML.Mark)
@ YAML ~/.julia/packages/YAML/twmeD/src/scanner.jl:1362
[2] scan_flow_scalar(stream::YAML.TokenStream, style::Char)
@ YAML ~/.julia/packages/YAML/twmeD/src/scanner.jl:1293
[3] fetch_flow_scalar
@ ~/.julia/packages/YAML/twmeD/src/scanner.jl:762 [inlined]
[4] fetch_double
@ ~/.julia/packages/YAML/twmeD/src/scanner.jl:750 [inlined]
[5] fetch_more_tokens(stream::YAML.TokenStream)
@ YAML ~/.julia/packages/YAML/twmeD/src/scanner.jl:267
[6] peek(stream::YAML.TokenStream)
@ YAML ~/.julia/packages/YAML/twmeD/src/scanner.jl:191
[7] parse_block_mapping_value(stream::YAML.EventStream)
@ YAML ~/.julia/packages/YAML/twmeD/src/parser.jl:459
[8] peek(stream::YAML.EventStream)
@ YAML ~/.julia/packages/YAML/twmeD/src/parser.jl:52
[9] compose_node(composer::YAML.Composer)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:87
[10] __compose_mapping_node(event::YAML.ScalarEvent, composer::YAML.Composer, node::YAML.MappingNode)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:148
[11] _compose_mapping_node(start_event::YAML.MappingStartEvent, composer::YAML.Composer, anchor::Nothing)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:168
[12] compose_mapping_node(composer::YAML.Composer, anchor::Nothing)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:177
[13] handle_event(event::YAML.MappingStartEvent, composer::YAML.Composer)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:81
[14] compose_node(composer::YAML.Composer)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:88
[15] compose_document(composer::YAML.Composer)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:46
[16] compose(events::YAML.EventStream, resolver::YAML.Resolver)
@ YAML ~/.julia/packages/YAML/twmeD/src/composer.jl:33
[17] load(tokenstream::YAML.TokenStream, constructor::YAML.Constructor)
@ YAML ~/.julia/packages/YAML/twmeD/src/YAML.jl:77
[18] load(ts::YAML.TokenStream, more_constructors::Nothing, multi_constructors::Dict{…}; dicttype::Type{…}, constructorType::typeof(YAML.SafeConstructor))
@ YAML ~/.julia/packages/YAML/twmeD/src/YAML.jl:84
[19] load
@ ~/.julia/packages/YAML/twmeD/src/YAML.jl:84 [inlined]
[20] load (repeats 3 times)
@ ~/.julia/packages/YAML/twmeD/src/YAML.jl:87 [inlined]
[21] #16
@ ~/.julia/packages/YAML/twmeD/src/YAML.jl:155 [inlined]
[22] open(::YAML.var"#16#17"{@Kwargs{}, Tuple{}}, ::String, ::Vararg{String}; kwargs::@Kwargs{})
@ Base ./io.jl:396
[23] open
@ ./io.jl:393 [inlined]
[24] load_file(::String)
@ YAML ~/.julia/packages/YAML/twmeD/src/YAML.jl:153
[25] top-level scope
@ REPL[8]:1
Some type information was truncated. Use `show(err)` to see complete types.
(jl_wPLlVl) pkg> st
Status `/tmp/jl_wPLlVl/Project.toml`
[ddb6d928] YAML v0.4.11 `https://github.com/JuliaData/YAML.jl.git#master`
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
YAML.jl seems to be producing ill-formated yaml when given the following input:
pkg> st YAML Project ZoteroToPapis v0.1.0 Status `~/.julia/dev/ZoteroToPapis/Project.toml` [ddb6d928] YAML v0.4.11 julia> versioninfo() Julia Version 1.10.4 Commit 48d4fd48430 (2024-06-04 10:41 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 4 × Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, skylake) Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores) Environment: LD_PRELOAD = /usr/lib64/libstdc++.so.6
This might be related to #108?
The text was updated successfully, but these errors were encountered: