-
Notifications
You must be signed in to change notification settings - Fork 191
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
0.10.1 bug: incorrect "ValueError: Circular reference detected" with multiple empty dictionaries #295
Comments
I had a similar problem. Check this gist: toml raises "ValueError: Circular reference detected" on some specific root keys. For some reason, the Lines 62 to 67 in 9c9d4be
|
I'm seeing the same issue on Python 3.7 and 3.8. I'm using regulars |
This appears to be a bug in the fix for #217 , which was introduced between 0.10.0 and 0.10.1 My current hypothesis is that the Python runtime creates an empty dictionary, the dictionary gets thrown away and the next time an empty dictionary is "created", the runtime decides to reuse the already created dictionary that was empty and is no longer referenced over allocating a new dictionary. |
Originally from toml/toml-lang README.md https://github.com/toml-lang/toml/blame/v1.0.0-rc.1/README.md#L714-L721 Exists in iarna/toml-spec-tests https://github.com/iarna/toml-spec-tests/blob/latest/values/spec-table-7.toml Causes uiri/toml#295 uiri/toml#295
Originally from toml/toml-lang README.md https://github.com/toml-lang/toml/blame/v1.0.0-rc.1/README.md#L714-L721 Exists in iarna/toml-spec-tests https://github.com/iarna/toml-spec-tests/blob/latest/values/spec-table-7.toml Causes uiri/toml#295 uiri/toml#295
I'm running into the same issue. I've been working around it, but it would be nice to have a fix. To that end, I would like to suggest using Illustrative example:
|
I didn't see this issue yet, but I was running into the same problem and created a pull request that |
version 0.10.1 causes a bug with how nested dicts are handled and we should stay with 0.10.0 until it is fixed: uiri/toml#295 Change-Id: Id6853599492ad869d25ee8b7f99afa9416926c2b
* Update requirements from branch 'master' - cap toml library because of nested dict bug version 0.10.1 causes a bug with how nested dicts are handled and we should stay with 0.10.0 until it is fixed: uiri/toml#295 Change-Id: Id6853599492ad869d25ee8b7f99afa9416926c2b
Hi @uiri, we encounter this issue quite a bit in our setup, and we are therefore pinned to 0.10.0. But now that other dependencies (like black) are requiring toml 0.10.1 this is starting to hold us back a bit. Do you have time to make a new release of toml in the near future? |
version 0.10.2 includes a fix for the nested dict bug: uiri/toml#295 And also happens to be the latest version currently. Change-Id: I22014ce24e1480cabe6b02c78a3bf5a23b066973 Signed-off-by: Matthew Thode <mthode@mthode.org>
version 0.10.2 includes a fix for the nested dict bug: uiri/toml#295 And also happens to be the latest version currently. Change-Id: I22014ce24e1480cabe6b02c78a3bf5a23b066973
version 0.10.1 causes a bug with how nested dicts are handled and we should stay with 0.10.0 until it is fixed: uiri/toml#295 Change-Id: Id6853599492ad869d25ee8b7f99afa9416926c2b
This only affects the latest version (
0.10.1
) and is fine in previous versions.Example file that will cause the error (taken from the toml-lang/toml readme):
The fourth line here (
[x.y.z.w]
) will cause the newValueError: Circular reference detected
exception intoml.dumps
.Example:
With version
0.10.0
:With version
0.10.1
:The text was updated successfully, but these errors were encountered: