This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Use 'ascii' instead of 'us-ascii' to bypass lookup machinery
Type: performance Stage:
Components: Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: scop, vstinner
Priority: normal Keywords: patch

Created on 2016-08-31 15:08 by scop, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ascii.patch scop, 2016-08-31 15:08 review
Messages (3)
msg274028 - (view) Author: Ville Skyttä (scop) * Date: 2016-08-31 15:08
https://docs.python.org/3/library/codecs.html#standard-encodings

There are a bunch of other us-ascii occurrences in the tree; this patch covers the ones that are not user visible in a way that could cause problems or changes in behavior.
msg274229 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-02 11:00
It looks like the email module has a special usage of the "us-ascii" encoding name. It's not just an alias to "ascii". So I proposed a patch implementing the fast-path differently in the Python builtin codecs: see my issue #27938.

The xml.etree module has special cases for the "us-ascii" encoding name, but not for "ascii". See the ElementTree.write() method. I proposed to also skip the XML declaration by default when "ascii" encoding is used: issue #27940.
msg274457 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-05 22:51
Since "us-ascii" got a fast-path thanks to the issue #27938, this patch is not needed anymore.
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 72102
2016-09-05 22:51:48vstinnersetstatus: open -> closed
resolution: out of date
messages: + msg274457
2016-09-02 11:00:33vstinnersetnosy: + vstinner
messages: + msg274229
2016-08-31 15:08:49scopcreate