-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Valid toml syntax causes black to crash #2280
Comments
Seems reasonable. It looks like pip itself still uses |
tomli looks promising. Hope it can get into the stdlib so toml can become "real" in python as a low level config file format. Thanks for raising this interesting issue. For now tho I think you're stuck using |
I see, yes it seems pip has the same issue. I'd argue there's still value in supporting the latest toml syntax, even if pip does not yet. In principle it should be a non breaking change, though I guess the bottom line is that any divergence presents a risk of unexpected consequences? |
I made an issue in pip issue tracker about this: pypa/pip#10034 Let's see if they have willingness to upgrade to a TOML v1.0.0 compatible parser. Edit: This also led to a proposal to change PEP 518 so that it includes a TOML spec version for pyproject.toml. |
Describe the bug
I have a pyproject.toml for configuring various other tools (not black), which includes a list with mixed type contents, as explicitly support by the v1.0.0 of the toml spec.
When I run black it crashes with a cryptic traceback from inside the toml library.
To Reproduce
Expected behavior
It shouldn't crash.
Environment (please complete the following information):
Since the presently used "toml" library explicitly only supports up to version 0.5.0 of the spec (from about two years ago), I'd suggest switching to tomlkit, which supports the current toml spec (officially up to 1.0.0rc1 but nothing has materially changed since then).
I'd be happy to put together a PR if this approach is deemed acceptable in principle.
The text was updated successfully, but these errors were encountered: