Re: [Cython] Cython 0.23 released
Stefan Behnel schrieb am 17.08.2015 um 08:17: > Antoine Martin schrieb am 17.08.2015 um 06:09: >> On 09/08/15 13:54, Antoine Martin wrote: >>> I've just hit a regression with 0.23: a recursion loop generating code >>> for this particular pyx: >>> http://xpra.org/trac/browser/xpra/trunk/src/xpra/codecs/nvenc4/encoder.pyx >> >> I have narrowed it down to the problematic finally block via trial and >> error: >> http://xpra.org/trac/browser/xpra/trunk/src/xpra/codecs/nvenc4/encoder.pyx#L2024 >> Any of those statements, including the simple logging ones, cause >> Cython's "fresh_finally_clause" code to go into an infinite loop via >> deepcopy. >> >> What am I doing wrong here? >> Those statements look fine and they used to compile just fine too. > > Thanks for the report. This is a bug in the latest Cython release. I'll see > if I can come up with a fix. I couldn't reproduce it with any reasonable amount of test code yet, but does this fix it for you? https://github.com/cython/cython/commit/5a40d5459aad1c6f15fb8526f0144d3c0f1dfe76 Stefan ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Cython 0.23 released
On 17/08/15 14:14, Stefan Behnel wrote: > Stefan Behnel schrieb am 17.08.2015 um 08:17: >> Antoine Martin schrieb am 17.08.2015 um 06:09: >>> On 09/08/15 13:54, Antoine Martin wrote: I've just hit a regression with 0.23: a recursion loop generating code for this particular pyx: http://xpra.org/trac/browser/xpra/trunk/src/xpra/codecs/nvenc4/encoder.pyx >>> I have narrowed it down to the problematic finally block via trial and >>> error: >>> http://xpra.org/trac/browser/xpra/trunk/src/xpra/codecs/nvenc4/encoder.pyx#L2024 >>> Any of those statements, including the simple logging ones, cause >>> Cython's "fresh_finally_clause" code to go into an infinite loop via >>> deepcopy. >>> >>> What am I doing wrong here? >>> Those statements look fine and they used to compile just fine too. >> Thanks for the report. This is a bug in the latest Cython release. I'll see >> if I can come up with a fix. > I couldn't reproduce it with any reasonable amount of test code yet, but > does this fix it for you? > > https://github.com/cython/cython/commit/5a40d5459aad1c6f15fb8526f0144d3c0f1dfe76 I am afraid not, I still get the same stacktrace. Let me know if there's anything else I can try. Cheers Antoine > > Stefan > > ___ > cython-devel mailing list > cython-devel@python.org > https://mail.python.org/mailman/listinfo/cython-devel ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Cython 0.23: long + int == int
Jakub Wilk schrieb am 14.08.2015 um 10:41: > $ cython --version > Cython version 0.23 > $ python2.6 --version > Python 2.6.8 > $ cat testlong.pyx > def f(x): >return 0L + x > $ python2.6 -c 'import pyximport as p; p.install(); import testlong; print > type(testlong.f(42))' > > > I added a long to an int, so I'd expect the result to be a long. > This works correctly in Python 2.7: > > $ python2.7 -c 'import pyximport as p; p.install(); import testlong; print > type(testlong.f(42))' > > > It also worked correctly in Cython 0.22.1 + Python 2.6. I understand that this is not entirely correct, but does it pose any problems in practice? The "int" type has been removed in Py3, after all, so this behaviour will go away all by itself as soon as support for Python 2.x is removed at some point in the future. Stefan ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
[Cython] gcc error when compiling cython
Hey all, recently, I had a gcc compile time error with cython. The work around is obvious, as the problem happens when a cdef-ed numpy array in a function is unused. Nevertheless, I feel it's useful to report the problem I had. The following is a test case test.pyx import numpy as np cimport numpy as np def f(np.ndarray[dtype=np.int_t, ndim=2] arg1): cdef np.ndarray[dtype=np.int_t, ndim=2] arr return 3 - setup.py from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("test.pyx"), ) -- This gives me the error error: ‘__pyx_pybuffernd_arr’ undeclared Full shell output: ~/tmp/ctest > python setup.py build_ext --inplace running build_ext building 'test' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c test.c -o build/temp.linux-x86_64-2.7/test.o In file included from /usr/include/python2.7/numpy/ndarraytypes.h:1761:0, from /usr/include/python2.7/numpy/ndarrayobject.h:17, from /usr/include/python2.7/numpy/arrayobject.h:4, from test.c:250: /usr/include/python2.7/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] #warning "Using deprecated NumPy API, disable it by " \ ^ test.c: In function ‘__pyx_pf_4test_f’: test.c:1240:30: error: ‘__pyx_pybuffernd_arr’ undeclared (first use in this function) __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); ^ test.c:1240:30: note: each undeclared identifier is reported only once for each function it appears in In file included from /usr/include/python2.7/numpy/ndarrayobject.h:26:0, from /usr/include/python2.7/numpy/arrayobject.h:4, from test.c:250: test.c: At top level: /usr/include/python2.7/numpy/__multiarray_api.h:1629:1: warning: ‘_import_array’ defined but not used [-Wunused-function] _import_array(void) ^ In file included from /usr/include/python2.7/numpy/ufuncobject.h:327:0, from test.c:251: /usr/include/python2.7/numpy/__ufunc_api.h:241:1: warning: ‘_import_umath’ defined but not used [-Wunused-function] _import_umath(void) ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel