<#17848 cryptic error message with malformed pants...
# github-notifications
q
#17848 cryptic error message with malformed pants.toml Issue created by adityav Describe the bug Hi. So I was messing about with the pants.toml and ran into a very cryptic error message:
Copy code
➜ ./pants --no-pantsd -l=debug  generate-lockfiles
06:23:00.28 [WARN] /Users/vish/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.Z3K0Pi/install/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/specifiers.py:255: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
  warnings.warn(

06:23:00.28 [ERROR] 1 Exception encountered:

  InvalidRequirement: Parse error at "'='": Expected string_end
Wasn’t helping. Anyways, after messing about the toml file a bit more and checking git diffs, I was able to resolve it. What I had done was this:
Copy code
[python.resolves_to_interpreter_constraints]
airflow-default = "CPython>=3.7.10, <3.8"
The correct way is to set it as an array:
Copy code
[python.resolves_to_interpreter_constraints]
airflow-default = ["CPython>=3.7.10, <3.8"]
I think these kinds of mistakes can occur. if the error message pointed to line or even say the error was in toml file, I would have been able to resolve it more easily. It isn’t critical, but a nice usability improvement Pants version 2.14.0 OS Are you encountering the bug on MacOS, Linux, or both? MacOS Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant. https://pantsbuild.slack.com/archives/C046T6T9U/p1671498486776469 pantsbuild/pants