Donald Stufft

Results 289 comments of Donald Stufft

> I think the thing we can all agree on is people have various uses for getting the data out of bytes and into a format that can be programmatically...

I'm going to sketch up a PR here, and see how things turn out!

Something that I noticed while implementing this: PEP 566 says this about converting metadata into json: > It may be necessary to store metadata in a data structure which does...

Next fun fact! You can't actually use ``BytesParser``, ``BytesFeedParser``, or ``message_from_bytes`` to parse ``METADATA`` files, because ``METADATA`` files are explicitly utf8, and all of those classes are implemented such that...

Nope. The [message_from_bytes](https://github.com/python/cpython/blob/6654392587ede1c8e595a8fcdd273a02bc04ea51/Lib/email/__init__.py#L40-L46) function is a thin wrapper around ``ByteParser.parsebytes``. The [ByteParser](https://github.com/python/cpython/blob/6654392587ede1c8e595a8fcdd273a02bc04ea51/Lib/email/parser.py#L99-L123) class is entirely implemented as a wrapper around ``FeedParser``, with hard coded calls to decoding the bytes with...

Of course, if you don't care about being lenient, you can just do ``message_from_string(binary_content.decode("utf8"), policy=email.policy.compat32)``. That will correctly parse the ``METADATA`` file as UTF8, but one of the things Paul...

Unless I missed it (which I'm very tired at the moment, so it's possible!) it just calls ``message_from_bytes``, which does the wrong thing even on valid data?

No worries, I'll have to look at it tomorrow anyways, my brain is dead for the night and can't stand staring at the email module anymore tonight :) https://github.com/pypa/packaging/pull/574 here's...

There's one tiny bit of ambiguity here, PEP 427 escaping doesn't require canonicalizing the name, while PEP 625 does. However, in practice the practical difference between those two statements is...

You missed a part: > The name of an sdist should be {distribution}-{version}.sdist. > > * distribution is the name of the distribution as defined in [PEP 345](https://peps.python.org/pep-0345), and normalised...