Author: Philip Jenvey <[email protected]>
Branch: py3.3
Changeset: r75151:24d64c593bda
Date: 2014-12-29 13:12 -0800
http://bitbucket.org/pypy/pypy/changeset/24d64c593bda/

Log:    handle a base_encoding of 'utf-8' on osx

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
@@ -168,7 +168,10 @@
         w_import = space.getattr(space.builtin, space.wrap("__import__"))
         space.call_function(w_import, space.wrap("encodings"))
         from pypy.module.sys.interp_encoding import base_encoding
-        space.call_function(w_import, space.wrap("encodings." + base_encoding))
+        # May be 'utf-8'
+        normalized_base = base_encoding.replace("-", "_").lower()
+        space.call_function(w_import, space.wrap("encodings." +
+                                                 normalized_base))
         state.codec_need_encodings = False
         if len(state.codec_search_path) == 0:
             raise OperationError(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to