-
Notifications
You must be signed in to change notification settings - Fork 190
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
Roundtripping inlined tables with '000..'
fails..
#400
Comments
Further follow up. tml = '''
['section0."section1"']
clears = { "0000e22a.63f7e33f.01.01" = { cost = 1 }
, "0000e22a.63f7e33d.01.01" = { cost = 0 }
, "0000e22a.63f7e346.01.01" = { cost = 0.355 }
, "0000e22a.63f7e347.01.01" = { cost = 0.5 }
, "0000e22a.63fc4d7a.01.01" = { cost = 1 }
, "0000e22a.64168864.01.01" = { cost = 1 }
}
'''
table = toml.loads(tml) #, encoder=enc)
print("READING TABLE") The original inline table style was generated using suggestions from #383, but according to the spec, this output is invalid? Output error:
Interestingly changing the contents to the following avoids this parse error? ['section0."section1"']
clears = { "0000e22a.63f7e33f.01.01" = { cost = 1 } \
, "0000e22a.63f7e33d.01.01" = { cost = 0 } \
, "0000e22a.63f7e346.01.01" = { cost = 0.355 } \
, "0000e22a.63f7e347.01.01" = { cost = 0.5 } \
, "0000e22a.63fc4d7a.01.01" = { cost = 1 } \
, "0000e22a.64168864.01.01" = { cost = 1 } \
} So it would seem that writing inline tables isn't working in a way that they can be read back, but oddly only when some other strange logic is causing an unrelated, and incorrect, key parsing hangup. |
If y'all want me to write some tests up for this stuff i think i can manage 😂 |
Ahh so looking at the spec: https://toml.io/en/v1.0.0#inline-table
Thus i guess the motivation for #396 to work if you want to separate inline-table entries by newlines. |
Probably relates to #396 and #383.
The following small script exemplifies this:
The 2nd roundtrip will fail with:
executing.executing.NotOneValueFound: Expected one value, found 0
With more complex scenarios the errors are different (which i can also report if needed) but I'm pretty sure this is the root issue?
The text was updated successfully, but these errors were encountered: