[New-bugs-announce] [issue26519] Cython doesn't work anymore on Python 3.6

STINNER Victor report at bugs.python.org
Wed Mar 9 11:01:57 EST 2016

New submission from STINNER Victor:

I tried to run numpy test suite on Python 3.6 compiled in debug mode. I got an assertion error. Then I wanted to try the Git version of numpy, but the "Cythonizing sources" step of the numpy installer fails with:
Traceback (most recent call last):
  File "bin/cython", line 9, in <module>
    load_entry_point('Cython==0.23.4', 'console_scripts', 'cython')()
  File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 6585, in generate_execution_code
  File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 7026, in generate_execution_code
  File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 7013, in fresh_finally_clause
    node_copy = copy.deepcopy(node)
  File "/home/haypo/prog/python/default/Lib/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/home/haypo/prog/python/default/Lib/copy.py", line 314, in _reconstruct
    item = deepcopy(item, memo)
  File "/home/haypo/prog/python/default/Lib/copy.py", line 174, in deepcopy
    rv = reductor(4)
TypeError: can't pickle Argument objects
Argument class indirectly comes from Cython.Compiler.Nodes.ExprStatNode.

Command to reproduce the bug:
tar -xf mtrand.tar.gz  # download mtrand.tar.gz attached to this issue
python -m venv ENV
ENV/bin/python -m pip install cython
ENV/bin/python ENV/bin/cython --fast-fail -o mtrand.c mtrand.pyx

It looks like cython behaviour failed after this change:
changeset:   99677:b8d108a2a38e
parent:      99675:80d1faa9735d
parent:      99676:0cd2de69fb66
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Dec 25 21:05:35 2015 +0200
files:       Lib/test/test_csv.py Misc/NEWS Objects/typeobject.c
Issue #22995: Instances of extension types with a state that aren't
subclasses of list or dict and haven't implemented any pickle-related
methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__,
or __getstate__), can no longer be pickled.  Including memoryview.

Sorry, I don't understand yet if it's a regression in Python 3.6 or a real bug in Cython.

files: mtrand.tar.gz
messages: 261437
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Cython doesn't work anymore on Python 3.6
versions: Python 3.6
Added file: http://bugs.python.org/file42105/mtrand.tar.gz

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list