Test failures with Python 2.7:

======================================================================
ERROR: test_all (Cython.Debugger.Tests.TestLibCython.TestAll)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/Debugger/Tests/TestLibCython.py",
 line 177, in setUp
    python_version_number = [int(a.strip()) for a in 
python_version.strip('()').split(',')[:3]]
ValueError: invalid literal for int() with base 10: 'sys.version_info(major=2'

======================================================================
ERROR: runTest (__main__.EndToEndTest)
End-to-end basic_cythonize.srctree
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 797, in setUp
    os.path.join('tests', 'build', self.treefile), self.workdir)
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/TestUtils.py",
 line 176, in unpack_source_tree
    f = open(tree_file)
IOError: [Errno 2] No such file or directory: 
'tests/build/basic_cythonize.srctree'

======================================================================
ERROR: runTest (__main__.EndToEndTest)
End-to-end basic_distutils.srctree
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 797, in setUp
    os.path.join('tests', 'build', self.treefile), self.workdir)
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/TestUtils.py",
 line 176, in unpack_source_tree
    f = open(tree_file)
IOError: [Errno 2] No such file or directory: 
'tests/build/basic_distutils.srctree'

======================================================================
ERROR: runTest (__main__.EndToEndTest)
End-to-end cpp_cythonize.srctree
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 797, in setUp
    os.path.join('tests', 'build', self.treefile), self.workdir)
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/TestUtils.py",
 line 176, in unpack_source_tree
    f = open(tree_file)
IOError: [Errno 2] No such file or directory: 
'tests/build/cpp_cythonize.srctree'

======================================================================
ERROR: runTest (__main__.EndToEndTest)
End-to-end cythonize_options.srctree
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 797, in setUp
    os.path.join('tests', 'build', self.treefile), self.workdir)
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/TestUtils.py",
 line 176, in unpack_source_tree
    f = open(tree_file)
IOError: [Errno 2] No such file or directory: 
'tests/build/cythonize_options.srctree'

======================================================================
ERROR: runTest (__main__.EndToEndTest)
End-to-end inline_distutils.srctree
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 797, in setUp
    os.path.join('tests', 'build', self.treefile), self.workdir)
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/Cython/TestUtils.py",
 line 176, in unpack_source_tree
    f = open(tree_file)
IOError: [Errno 2] No such file or directory: 
'tests/build/inline_distutils.srctree'

======================================================================
ERROR: test_embed (__main__.EmbedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 847, in setUp
    os.chdir(self.working_dir)
OSError: [Errno 2] No such file or directory: 'Demos/embed'

======================================================================

sys.version_info.__str__() has changed in Python 2.7:
$ python2.6 -c 'import sys; print(sys.version_info)'
(2, 6, 6, 'final', 0)
$ python2.7 -c 'import sys; print(sys.version_info)'
sys.version_info(major=2, minor=7, micro=2, releaselevel='alpha', serial=0)

The first test from the above list fails earlier with Python 3.1:

======================================================================
ERROR: test_all (Cython.Debugger.Tests.TestLibCython.TestAll)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/var/tmp/portage/dev-python/cython-0.14.1_rc2/work/Cython-0.14.1rc2/BUILD/Cy3/Cython/Debugger/Tests/TestLibCython.py",
 line 171, in setUp
    python_version_script.write('python import sys; print sys.version_info\n')
TypeError: must be bytes or buffer, not str

======================================================================

I'm attaching untested patch for the first failing test. I didn't have time
to investigate other test failures.

-- 
Arfrever Frehtes Taifersar Arahesis
--- Cython/Debugger/Tests/TestLibCython.py
+++ Cython/Debugger/Tests/TestLibCython.py
@@ -167,14 +167,14 @@
             p.stdout.close()
 
         if have_gdb:
-            python_version_script = tempfile.NamedTemporaryFile()
-            python_version_script.write('python import sys; print sys.version_info\n')
+            python_version_script = tempfile.NamedTemporaryFile(mode='w+')
+            python_version_script.write('python import sys; print(" ".join(str(x) for x in sys.version_info[:3]))\n')
             python_version_script.flush()
             p = subprocess.Popen(['gdb', '-batch', '-x', python_version_script.name],
                                  stdout=subprocess.PIPE)
             python_version = p.stdout.read().decode('ascii')
             p.wait()
-            python_version_number = [int(a.strip()) for a in python_version.strip('()').split(',')[:3]]
+            python_version_number = [int(a) for a in python_version.split()]
 
         if have_gdb:
             # Based on Lib/test/test_gdb.py

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to