Skip to content
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

Strange error message when processing a file with a directive %YAML 2.0 #147

Closed
Paalon opened this issue Jun 5, 2024 · 1 comment
Closed

Comments

@Paalon
Copy link
Contributor

Paalon commented Jun 5, 2024

According to https://yaml.org/spec/1.2.2/, 6.8.1.,

Documents with a “YAML” directive specifying a higher major version (e.g. “%YAML 2.0”) should be rejected with an appropriate error message.

But the following gives strange error message.

julia> YAML.load("""%YAML 2.0\n---\nhello: world""")
ERROR: type DirectiveToken has no field start_mark
Stacktrace:
  [1] getproperty(x::YAML.DirectiveToken, f::Symbol)
    @ Base ./Base.jl:37
  [2] process_directives(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/parser.jl:96
  [3] parse_document_start(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/parser.jl:176
  [4] parse_implicit_document_start(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/parser.jl:155
  [5] forward!(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/parser.jl:73
  [6] compose_document(composer::YAML.Composer)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/composer.jl:49
  [7] compose(events::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/composer.jl:38
  [8] load(ts::YAML.TokenStream, constructor::YAML.Constructor)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/YAML.jl:38
  [9] load(ts::YAML.TokenStream, more_constructors::Nothing, multi_constructors::Dict{…}; dicttype::Type{…}, constructorType::typeof(YAML.SafeConstructor))
    @ YAML ~/.julia/packages/YAML/6ydWl/src/YAML.jl:44
 [10] load
    @ ~/.julia/packages/YAML/6ydWl/src/YAML.jl:44 [inlined]
 [11] load (repeats 3 times)
    @ ~/.julia/packages/YAML/6ydWl/src/YAML.jl:47 [inlined]
 [12] load(::String)
    @ YAML ~/.julia/packages/YAML/6ydWl/src/YAML.jl:88
 [13] top-level scope
    @ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types.
@Paalon
Copy link
Contributor Author

Paalon commented Jun 22, 2024

I think this is now solved.

@Paalon Paalon closed this as completed Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants