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

Describe the file format of core metadata #851

Merged
merged 2 commits into from Mar 7, 2021

Conversation

takluyver
Copy link
Member

Following this discussion on discourse. The file format of core metadata is not precisely defined (PEP 241 said RFC 822, but that's outdated in practice), but there is a practical standard: the major tools consuming metadata use the email.parser module with the (default) compat32 policy. I think it's better to describe the situation than to leave it completely unspecified.

Hopefully this is an interim measure until someone gets around to describing the format properly. But that's a much bigger job, and so far no-one is volunteering.

@pyfisch
Copy link

pyfisch commented Mar 6, 2021

While I've started a discussion to specify the format in greater detail there are two things that can be checked to ensure invalid files are rejected by tools:

  1. Make sure the defects attribute is the empty list.
  2. Check if the message contains both a Description header and a non-empty payload. This is a unambiguous sign that the message syntax is invalid.

@webknjaz webknjaz added the type: enhancement A self-contained enhancement or new feature label Mar 7, 2021
@webknjaz webknjaz enabled auto-merge March 7, 2021 02:21
@webknjaz
Copy link
Member

webknjaz commented Mar 7, 2021

I think this change is good and any additional changes can be submitted as follow-up PRs.

@webknjaz webknjaz merged commit 32fa215 into pypa:main Mar 7, 2021
@takluyver takluyver deleted the core-metadata-email-fmt branch April 25, 2021 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A self-contained enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants