A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2010-October/098701.html below:

[Python-checkins] r85739 - in python/branches/issue4388/Lib/test: script_helper.py test_cmd_line.py

[Python-checkins] r85739 - in python/branches/issue4388/Lib/test: script_helper.py test_cmd_line.pyvictor.stinner python-checkins at python.org
Wed Oct 20 14:06:46 CEST 2010
Author: victor.stinner
Date: Wed Oct 20 14:06:46 2010
New Revision: 85739

Log:
test_run_code() of test_cmd_line deletes LC_ALL, LC_CTYPE and LANG environment variables


Modified:
   python/branches/issue4388/Lib/test/script_helper.py
   python/branches/issue4388/Lib/test/test_cmd_line.py

Modified: python/branches/issue4388/Lib/test/script_helper.py
==============================================================================
--- python/branches/issue4388/Lib/test/script_helper.py	(original)
+++ python/branches/issue4388/Lib/test/script_helper.py	Wed Oct 20 14:06:46 2010
@@ -15,11 +15,11 @@
 from test.support import make_legacy_pyc
 
 # Executing the interpreter in a subprocess
-def _assert_python(expected_success, *args):
+def _assert_python(expected_success, *args, **kw):
     cmd_line = [sys.executable, '-E']
     cmd_line.extend(args)
     p = subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
-                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+                         stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kw)
     try:
         out, err = p.communicate()
     finally:
@@ -31,8 +31,8 @@
             "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
     return rc, out, err
 
-def assert_python_ok(*args):
-    return _assert_python(True, *args)
+def assert_python_ok(*args, **kw):
+    return _assert_python(True, *args, **kw)
 
 def assert_python_failure(*args):
     return _assert_python(False, *args)

Modified: python/branches/issue4388/Lib/test/test_cmd_line.py
==============================================================================
--- python/branches/issue4388/Lib/test/test_cmd_line.py	(original)
+++ python/branches/issue4388/Lib/test/test_cmd_line.py	Wed Oct 20 14:06:46 2010
@@ -103,8 +103,15 @@
         if sys.getfilesystemencoding() != 'ascii':
             if test.support.verbose:
                 import locale
+                env = os.environ.copy()
+                for key in ('LC_ALL', 'LC_CTYPE', 'LANG'):
+                    try:
+                        del env[key]
+                    except KeyError:
+                        pass
                 print('locale encoding = %s, filesystem encoding = %s'
-                      % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
+                      % (locale.getpreferredencoding(), sys.getfilesystemencoding()),
+                      env=env)
             command = "assert(ord('\xe9') == 0xe9)"
             assert_python_ok('-c', command)
 
More information about the Python-checkins mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4