[pypy-commit] pypy py3.3: Try to fix the encoding bootstrap issue.

amauryfa noreply at buildbot.pypy.org
Sun Dec 14 19:42:27 CET 2014


Author: Amaury Forgeot d'Arc <amauryfa at 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(


More information about the pypy-commit mailing list