Signature email requires ASCII on Python 2 but requires Unicode only "str" on Python 3
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
Signature_init in signature.c currently uses the s format string for parsing the email argument. This is inconsistent between Python 2 and 3. On Python 2, it accepts either text (unicode) or bytes (str) and implicitly encodes text using the default system encoding, which is ascii by default (and it seems like changing it is kind of weird and not really recommended by most people). Python 3, it only accepts text (str), and it's implicitly encodes it using UTF-8.
The name argument for Signature_init just uses O and accepts either text or bytes. It appears to implicitly encode text using UTF-8 and leaves bytes as-is. I would expect the email argument to work the same way.
So there's currently no way to pass in bytes on Python 3 and no way to pass in non-ASCII text on Python 2.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in signature.c at Signature_init and inspect how the email argument is parsed compared with the name argument. Verify behavior on Python 2 and Python 3; done means email accepts bytes on Python 3 and non-ASCII text on Python 2 consistently with name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100