Author: Amaury Forgeot d'Arc <amaur...@gmail.com>
Branch: py3.3
Changeset: r74927:7470b99dce17
Date: 2014-12-14 19:12 +0100
http://bitbucket.org/pypy/pypy/changeset/7470b99dce17/

Log:    Try to fix the encoding bootstrap issue. Now pypy starts with
        LANG=C.

diff --git a/pypy/module/_codecs/interp_codecs.py 
b/pypy/module/_codecs/interp_codecs.py
--- a/pypy/module/_codecs/interp_codecs.py
+++ b/pypy/module/_codecs/interp_codecs.py
@@ -162,12 +162,13 @@
 def _lookup_codec_loop(space, encoding, normalized_encoding):
     state = space.fromcache(CodecState)
     if state.codec_need_encodings:
+        # registers new codecs.
+        # This import uses the "builtin" import method, and is needed
+        # to bootstrap the full importlib module.
         w_import = space.getattr(space.builtin, space.wrap("__import__"))
-        # registers new codecs
         space.call_function(w_import, space.wrap("encodings"))
-        # XXX needed to bootstrap the importlib module.
-        # I hope we don't have to import all encodings here.
-        space.call_function(w_import, space.wrap("encodings.utf_8"))
+        from pypy.module.sys.interp_encoding import base_encoding
+        space.call_function(w_import, space.wrap("encodings." + base_encoding))
         state.codec_need_encodings = False
         if len(state.codec_search_path) == 0:
             raise OperationError(
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to