Issue 3592: Patch to add imp.get_codingspec() - Python tracker

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
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, brett.cannon, christian.heimes
Priority: low Keywords: patch

Created on 2008-08-18 21:13 by brett.cannon, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
reviewed_get_encodingspec.diff brett.cannon, 2008-08-18 21:13
Messages (3)
msg71379 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-08-18 21:13
Attached is a patch to add imp.get_codingspec(); a function that returns
the encoding of a source file.

The motivation is to remove the import of the re module in linecache to
speed up interpreter startup.
msg71380 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-08-18 21:14
It should be noted the original patch by Christian had a check for bad
tokenizing. Turns out that if you have that in several tests fail,
including test_modulefinder. This might mean there is a deeper problem
in the parser.
msg113412 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-08-09 12:59
We don't need this. We have tokenize.detect_encoding().