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

bugfix: items.Array __init__ didn't ignore Null that _group_values added. #221

Merged
merged 1 commit into from Aug 10, 2022

Conversation

laixintao
Copy link
Contributor

@laixintao laixintao commented Aug 9, 2022

The issue is, #218 added a _group_values cloud add Null into the Array values, but the Array's list.__init__ didn't ignore this value.

Poetry will copy.copy an Array item (for e.g. here: https://github.com/python-poetry/poetry-core/blob/main/src/poetry/core/packages/package.py#L290 ), then there will be an extra Null object in the values, so that an Array like this:

[tool.poetry]
classifiers = [
# comment
    "a",
    "b",
]

originally is ["a", "b"], after being copy.copyed, will become [None, "a", "b"] due to the Null. (Please see the testcase I added)

Then it will cause poetry to fail because there is an extra "None" in classifiers. ( https://github.com/laixintao/iredis/runs/7749027851?check_suite_focus=true )

related: #218

@laixintao
Copy link
Contributor Author

I found this issue in iredis' build:

It coincidentally has a comment line in classifiers:
https://github.com/laixintao/iredis/blob/d0cafb62607868fa9859214d1cefe9ae29d6b273/pyproject.toml#L12

the poetry failure: https://github.com/laixintao/iredis/runs/7749027851?check_suite_focus=true

cc @frostming

@frostming frostming merged commit a157e59 into python-poetry:master Aug 10, 2022
@frostming
Copy link
Collaborator

Thanks for catching this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tomlkit 0.11.2 issue parsing array with comment when later subsections are present
2 participants