[Cython] cython --create-listing fails

2012-09-12 Thread B. Clausius
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
when running:
$ cython --create-listing -o
build/temp.linux-x86_64-2.7/pybiklib/gldraw_c.c
build/temp.linux-x86_64-2.7/pybiklib/gldraw_c.pyx

I get the error:

Traceback (most recent call last):
  File "/usr/bin/cython", line 8, in 
main(command_line = 1)
  File "/usr/lib/pymodules/python2.7/Cython/Compiler/Main.py", line
662, in main
result = compile(sources, options)
  File "/usr/lib/pymodules/python2.7/Cython/Compiler/Main.py", line
637, in compile
return compile_multiple(source, options)
  File "/usr/lib/pymodules/python2.7/Cython/Compiler/Main.py", line
609, in compile_multiple
result = run_pipeline(source, options)
  File "/usr/lib/pymodules/python2.7/Cython/Compiler/Main.py", line
472, in run_pipeline
context.setup_errors(options, result)
  File "/usr/lib/pymodules/python2.7/Cython/Compiler/Main.py", line
399, in setup_errors
result.listing_file = Utils.replace_suffix(source, ".lis")
NameError: global name 'source' is not defined

I'm using Cython 0.15.1 . The patch is against git as it seems the
code there is same but tested only for 0.15.1.

B.C.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQUGjJAAoJEEDg0A3D0GN4Yj0QAKYHfo1C7bwl8a2pZi+DPrrE
N0T5KAzu3RjYgacw0MpC5hb+L1X6J5Yi3BAdIp4ertCY6xeKD6+lQt2q+zHK0De3
0CI4ivnh+yH/x5hvjRjDprrpotKc/tre0BWMpKpchw2ohZ21PRDmxpOsjFzTmyC0
V8TO0AG0hzpabzI9qNZRwyBz/GOzfFwyumKBDOv/z/2n2LDDBO+k10orfXrfhjdI
uFE6m1YAA4vK0apTi0F6GokJNq+vqT2pRNEzO/Fsek7kRxoNCAUrbzL0aKMj8wsz
M4wIUq8TE3R2d5cvEt+ibQK0+7OydoKoaiCd3BfumVsj5SBRio/GcMetJA1lThUn
W8e1yPtzPO/GlSatdvRiIJFzyzlX1ZVAfFXD419Gq0/X23/GK+j9k1rHQzg8e3+j
7yVph3DLfZfnQqmBpD3Xl4NCp7zYq7QgfdsB1GNzub/PEatfcv2DVLlnCDCTKgGu
j5/r/0dwrOkb1q3SGtONo/dAovSi0oIbW3Wfe4ebB8S1HVo9pFpPDIqc1g3xXRA2
laqc7vBAcE5ZfS5/uDmW74PMV1khDeDkhmhoEGSQbFTSSC40DwufvyBAPMyzjjvf
9JAvOp5FS9RS0020KPKIlOtxQXA+CrJSIbaQZu6m/nmH17a60QnW8kwZ799/Pqgd
IsacvSJvpYKHtQbg9JCJ
=Hav4
-END PGP SIGNATURE-
diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py
index 43f9610..1b72cec 100644
--- a/Cython/Compiler/Main.py
+++ b/Cython/Compiler/Main.py
@@ -345,7 +345,7 @@ class Context(object):
 def setup_errors(self, options, result):
 Errors.reset() # clear any remaining error state
 if options.use_listing_file:
-result.listing_file = Utils.replace_suffix(source, ".lis")
+result.listing_file = Utils.replace_suffix(result.main_source_file, ".lis")
 path = result.listing_file
 else:
 path = None
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] usage does not match the options

2012-09-12 Thread B. Clausius
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I found that the options shown by "cython -h" are different to the
options parsed by cython.

Usage: --warning-error
Parser: --warning-errors
The parser does not recognize "-q" and "-quiet"
(Patch attached)

There are other options that are not in the usage:
  -+
  -z, --pre-import
  --convert-range
  --no-c-in-traceback
  --disable-function-redefinition
  --old-style-globals
  --debug
  -h, --help

B.C.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQUIG1AAoJEEDg0A3D0GN4lN0QAKicvLAAcVqvJ6+12ErOSLxx
hzvJcIvjR9EBys3QMzq6+wfGY8JdzWA4ofn6VI+xtLkFDt9NhlpvB64UN1TUy1Nm
zj5IopRVV9VuKAvWxHoxk7QsuR2PmOd3ZR7d+v4xOxncfKmp1NNYYwuSvF9o232M
gdABJ3U34hGXhWTtVt21WkFqBgIQFnuWsCCzOokNL/rYuUEu1/AalFgy6Eko8xs8
V55bGXAFEgNCGJb/DPWglsTqoS3XJO4Wr7nt/N7ca6ejHo6Q0acA8GEcBikXM7kA
KI7swe/FwcNzz3FR0JflhbnzVltrR/bVGuhtjdElH2CNfSeX0lLIeihl9qmANYiZ
oGnl5n2Wmx/jUaFiEVmXa1ry+0xaNU10n7lv9zfAJYHt4xzF0HOmyudmviU34SVi
2w+SVPdBNH/08R0C3JPkcrLxN3L9RkXWzv6+bEsdtTGrWycQyXSLpVJn66OtAeKl
LoBJw2wzfibazKIWO7PuNW4VTz5Mcn4m8NG/ujEpw3WUE97mqRZRm9cp3opaeIjh
uZeWLUsEgn2GEMAwVrg10ILdverD08RX7ovyUqKCP84W03MV5fBHQISNAW2rS1ig
KXf1zm0lYr+W1MN9BnGQtqUTFSzxpnNJZ4KhDio+kAMc4bqbSk6R2ste2XXbS6/j
JGCc02zjM7TtSuw33oeJ
=8zfk
-END PGP SIGNATURE-
diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py
index 06d295f..65fba1d 100644
--- a/Cython/Compiler/CmdLine.py
+++ b/Cython/Compiler/CmdLine.py
@@ -20,7 +20,6 @@ Options:
   -o, --output-fileSpecify name of generated C file
   -t, --timestamps   Only compile newer source files
   -f, --forceCompile all source files (overrides implied -t)
-  -q, --quietDon't print module names in recursive mode
   -v, --verbose  Be verbose, print file names on multiple compilation
   -p, --embed-positions  If specified, the positions in Cython files of each
  function definition is embedded in its docstring.
@@ -38,7 +37,7 @@ Options:
   -2 Compile based on Python-2 syntax and code semantics.
   -3 Compile based on Python-3 syntax and code semantics.
   --fast-failAbort the compilation on the first error
-  --warning-error, -Werror   Make all warnings into errors
+  --warning-errors, -Werror  Make all warnings into errors
   --warning-extra, -Wextra   Enable extra warnings
   -X, --directive =[,___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] strange error message

2015-12-26 Thread B. Clausius
Hi cython devs,

a strange error message, showing cython internals:

$ cat gldraw.pxd
ctypedef float vec4[4]
ctypedef vec4 mat4[4]

$ cat glarea.pyx
cimport gldraw

cdef struct Data:
gldraw.mat4 matrix

cdef Data data

cdef void sync():
data.changed = True  # <- this wrong line produces the error

$ cython glarea.pyx

Error compiling Cython file:

...
void PyTuple_SET_ITEM(object  p, Py_ssize_t pos, object o)
void PyList_SET_ITEM(object  p, Py_ssize_t pos, object o)


@cname("__Pyx_carray_to_py_vec4")
cdef inline list __Pyx_carray_to_py_vec4(vec4 *v, Py_ssize_t length):
^


carray.to_py:112:41: 'vec4' is not a type identifier

Error compiling Cython file:

...
PyList_SET_ITEM(l, i, value)
return l


@cname("__Pyx_carray_to_tuple_vec4")
cdef inline tuple __Pyx_carray_to_tuple_vec4(vec4 *v, Py_ssize_t length):
^


carray.to_py:124:45: 'vec4' is not a type identifier

$ cython --version
Cython version 0.23.3

Best regards,

B.C.

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] strange error message

2016-01-01 Thread B. Clausius
Am 31.12.2015 um 01:00 schrieb Robert Bradshaw:
> On Mon, Dec 28, 2015 at 1:15 PM, Baptiste Carvello
>  wrote:
>> Le 28/12/2015 17:12, Baptiste Carvello a écrit :
>>> Hi,
>>>
>>> not a cython dev, but I believe I hit the very same problem (I'm going
>>> on vacation now, full report in January).
>>>
>>> You may fix the compilation error by adding the following unused import:
>> from gldraw import vec4
>>
>> sorry, that's a cimport, i.e.
>>
> from gldraw cimport vec4
> 
> +1, that's the solution. We should make the error better...

I added that line and replaced "cdef void sync():" by
"cpdef void sync():" to be able to test it:

$ cat glarea.pyx
cimport gldraw
from gldraw cimport vec4

cdef struct Data:
gldraw.mat4 matrix

cdef Data data

cpdef void sync():
data.changed = True  # <- this wrong line produces the error

It compiles without errors, but i get a exception at runtime (not
surprised):

$ python3
Python 3.4.3+ (default, Oct 14 2015, 16:03:50)
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import glarea
>>> glarea.sync()
Exception ignored in: 'glarea.sync'
AttributeError: 'dict' object has no attribute 'changed'
>>>

This would be ok for me, but i wonder if cython should recognize this at
compile time. The code tries to assign a new attribute to a cdef struct
and that will always fail, or am I wrong?

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel