Commits

Philip Jenvey committed 53e06c6

normalize filesystemencoding

  • Participants
  • Parent commits 4952d20
  • Branches py3k

Comments (0)

Files changed (2)

File pypy/module/sys/interp_encoding.py

                     w_res = space.call_method(codecmod, 'lookup',
                                               space.wrap(loc_codeset))
                     if space.is_true(w_res):
-                        encoding = loc_codeset
+                        w_name = space.getattr(w_res, space.wrap('name'))
+                        encoding = space.str_w(w_name)
             finally:
                 rlocale.setlocale(rlocale.LC_CTYPE, oldlocale)
         except rlocale.LocaleError:

File pypy/module/sys/test/test_encoding.py

             clear()
             os.environ.update(original_env)
 
-    assert get() in (base_encoding, 'ANSI_X3.4-1968')
-    assert get(LANG='foobar') in (base_encoding, 'ANSI_X3.4-1968')
-    assert get(LANG='en_US.UTF-8') == 'UTF-8'
-    assert get(LC_ALL='en_US.UTF-8') == 'UTF-8'
-    assert get(LC_CTYPE='en_US.UTF-8') == 'UTF-8'
+    assert get() in (base_encoding, 'ascii')
+    assert get(LANG='foobar') in (base_encoding, 'ascii')
+    assert get(LANG='en_US.UTF-8') == 'utf-8'
+    assert get(LC_ALL='en_US.UTF-8') == 'utf-8'
+    assert get(LC_CTYPE='en_US.UTF-8') == 'utf-8'