subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1743591 - /subversion/trunk/build/run_tests.py
Date Fri, 13 May 2016 02:19:12 GMT
Author: stefan2
Date: Fri May 13 02:19:12 2016
New Revision: 1743591

URL: http://svn.apache.org/viewvc?rev=1743591&view=rev
Log:
Make our test runner locale independent in Python 3.

Running our test suite with autodavcheck will change the environment
such that text files default to ascii - causing some test scripts to
fail upon loading.

* build/run_tests.py
  (TestHarness._run_py_test): Explicitly load our tests as UTF-8 when
                              supported. We can't load as binary here
                              because Windows tests would fail miserably.

Modified:
    subversion/trunk/build/run_tests.py

Modified: subversion/trunk/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/run_tests.py?rev=1743591&r1=1743590&r2=1743591&view=diff
==============================================================================
--- subversion/trunk/build/run_tests.py (original)
+++ subversion/trunk/build/run_tests.py Fri May 13 02:19:12 2016
@@ -809,8 +809,13 @@ class TestHarness:
   def _run_py_test(self, progabs, progdir, progbase, test_nums, dot_count):
     'Run a python test, passing parameters as needed.'
     try:
-      prog_mod = imp.load_module(progbase[:-3], open(progabs, 'r'), progabs,
-                                 ('.py', 'U', imp.PY_SOURCE))
+      if sys.version_info < (3, 0):
+        prog_mod = imp.load_module(progbase[:-3], open(progabs, 'r'), progabs,
+                                   ('.py', 'U', imp.PY_SOURCE))
+      else:
+        prog_mod = imp.load_module(progbase[:-3],
+                                   open(progabs, 'r', encoding="utf-8"),
+                                   progabs, ('.py', 'U', imp.PY_SOURCE))
     except:
       print("\nError loading test (details in following traceback): " + progbase)
       traceback.print_exc()



Mime
View raw message