-
Notifications
You must be signed in to change notification settings - Fork 61
email.errors.HeaderWriteError: folded header contains newline #1006
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
Comments
Means the |
The old style license field (licence.text and license.file) was never supposed to contain full license text. It’s supposed to contain a one line description of deviations from the license Trove classifier. This was not ideal so it was replaced in METADATA 2.4 with SPDX license classifiers and license-files. (The email format that metadata is based on does not support multiple lines, only the body does which is where the readme goes) |
Do you have a link to your pyproject.toml? |
Pyproject.toml wise, yours is correct. Seems to be an issue with |
Is the root issue the final new line that is not stripped and maybe somewhere else the additional padding is lost from scikit-build-core/src/scikit_build_core/_vendor/pyproject_metadata/__init__.py Lines 182 to 189 in 47431d4
|
Update: the trailing $ diff /usr/lib64/python3.1{1,2}/email/policy.py
24c24
< linesep_splitter = re.compile(r'\n|\r')
---
> linesep_splitter = re.compile(r'\n|\r\n?')
122c122
< remainder of the first line, joining all subsequent lines together, and
---
> remainder of the first line joined with all subsequent lines, and
128c128
< value = value.lstrip(' \t') + ''.join(sourcelines[1:])
---
> value = ''.join((value, *sourcelines[1:])).lstrip(' \t\r\n')
208c208,209
< lines = value.splitlines()
---
> # We can't use splitlines here because it splits on more than \r and \n.
> lines = linesep_splitter.split(value) |
"readme" is special, since it's the body of the email message. I have a feeling I know what's wrong. Adding a test to pyproject-metadata to see. |
Ahh, couldn't reproduce, then finally found this: https://github.com/njzjz/openbabel-wheel/blob/86cb7de5a5194084bc644b8eab44bb6565d2c206/LICENSE#L113 Ignore the unhelpful message, that's what's tripping it up. Edit: This is the sequence: I'm not sure we shouldn't just leave the |
Ah that explains why python/cpython#117313 is fixing it.
But |
I initially have proposed filtering out these, but maybe we could instead do the fix in the "workaround" in that link.
Oops, forgot that there wasn't a field for this. Yes, I guess we are supposed to stick this in. Really users shouldn't ever use |
Fun fact: pre-commit would have fixed the form feeds in this file for you. ;) Also, this was fixed in CPython 3.12.4. |
I've got a workaround in pypa/pyproject-metadata#232. |
Not sure what this error means...
The text was updated successfully, but these errors were encountered: