[Python-checkins] r58490 - sandbox/trunk/import_in_py/Py3K/_importlib.py

brett.cannon python-checkins at python.org
Tue Oct 16 01:23:29 CEST 2007


Author: brett.cannon
Date: Tue Oct 16 01:23:29 2007
New Revision: 58490

Modified:
   sandbox/trunk/import_in_py/Py3K/_importlib.py
Log:
Add yet another comment about how to possibly deal with source file encodings
and -*- markers through exposing more of the C implementation of import.c.

Either way, though, if the imp API stays (e.g., imp.find_module()) then
exposing this won't help with opening the file object properly.


Modified: sandbox/trunk/import_in_py/Py3K/_importlib.py
==============================================================================
--- sandbox/trunk/import_in_py/Py3K/_importlib.py	(original)
+++ sandbox/trunk/import_in_py/Py3K/_importlib.py	Tue Oct 16 01:23:29 2007
@@ -142,6 +142,7 @@
         # XXX One possible solution is to read the file in as bytes, do the
         #  universal newline translation, and then look for the -*- stanza to
         #  then do a bytes.decode() call (basically do PEPs 263 and 278).
+        # XXX Otherwise consider exposing Python/import.c:parse_source_module().
         return open(path, flags, encoding=(None if 'b' in flags else "utf8"))
     except NameError:
         return DinkyFile(path, flags)


More information about the Python-checkins mailing list