[Cython] Bug report: building an extension with --pyrex-gdb fails

2011-12-17 Thread Lars Buitinck
Hello all,

I was trying to build a C++ extension with debugging support as
described in http://docs.cython.org/src/userguide/debugging.html, but
I got an error from the Cython compiler:


lars@schoothond:~/src/sortedcollections$ python setup.py build_ext
--inplace --pyrex-gdb
running build_ext
cythoning sortedcollections/set.pyx to sortedcollections/set.cpp
Traceback (most recent call last):
  File "setup.py", line 9, in 
language="c++")]
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py",
line 125, in run
_build_ext.build_ext.run(self)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py",
line 132, in build_extensions
ext.sources = self.cython_sources(ext.sources, ext)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py",
line 275, in cython_sources
full_module_name=module_name)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py",
line 625, in compile
return compile_single(source, options, full_module_name)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py",
line 570, in compile_single
return run_pipeline(source, options, full_module_name)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py",
line 462, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Pipeline.py",
line 313, in run_pipeline
data = phase(data)
  File "Visitor.py", line 276, in
Cython.Compiler.Visitor.CythonTransform.__call__
(Cython/Compiler/Visitor.c:5173)
  File "Visitor.py", line 259, in
Cython.Compiler.Visitor.VisitorTransform.__call__
(Cython/Compiler/Visitor.c:4917)
  File "Visitor.py", line 165, in
Cython.Compiler.Visitor.TreeVisitor._visit
(Cython/Compiler/Visitor.c:3401)
  File 
"/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ParseTreeTransforms.py",
line 2613, in visit_ModuleNode
self.visit_FuncDefNode(nested_funcdef)
  File 
"/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ParseTreeTransforms.py",
line 2660, in visit_FuncDefNode
self.tb.start('Function', attrs=attrs)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Debugger/DebugWriter.py",
line 52, in start
self.tb.start(name, attrs or {})
  File "saxparser.pxi", line 398, in lxml.etree.TreeBuilder.start
(src/lxml/lxml.etree.c:83668)
  File "saxparser.pxi", line 430, in
lxml.etree.TreeBuilder._handleSaxStart (src/lxml/lxml.etree.c:84030)
  File "apihelpers.pxi", line 224, in lxml.etree._makeSubElement
(src/lxml/lxml.etree.c:12831)
  File "apihelpers.pxi", line 219, in lxml.etree._makeSubElement
(src/lxml/lxml.etree.c:12756)
  File "apihelpers.pxi", line 299, in lxml.etree._initNodeAttributes
(src/lxml/lxml.etree.c:13615)
  File "apihelpers.pxi", line 1364, in lxml.etree._utf8
(src/lxml/lxml.etree.c:22190)
TypeError: Argument must be bytes or unicode, got 'NoneType'


My setup.py is :


from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("sortedcollections.set",
 ["sortedcollections/set.pyx"],
 language="c++")]
)


Importing Extension from Cython.Distutils.extension and adding
pyrex_gdb=True to the Extension gives the same error.

Regards,

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug report: building an extension with --pyrex-gdb fails

2011-12-17 Thread Lars Buitinck
2011/12/17 Lars Buitinck :
> I was trying to build a C++ extension with debugging support as
> described in http://docs.cython.org/src/userguide/debugging.html, but
> I got an error from the Cython compiler:

Forgot to mention: I was using the very latest Git version of Cython,
a04c0f4eccc96ad475360cf3844b5792bd077836.

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug report: building an extension with --pyrex-gdb fails

2011-12-17 Thread mark florisson
On 17 December 2011 12:40, Lars Buitinck  wrote:
> 2011/12/17 Lars Buitinck :
>> I was trying to build a C++ extension with debugging support as
>> described in http://docs.cython.org/src/userguide/debugging.html, but
>> I got an error from the Cython compiler:
>
> Forgot to mention: I was using the very latest Git version of Cython,
> a04c0f4eccc96ad475360cf3844b5792bd077836.
>
> --
> Lars Buitinck
> Scientific programmer, ILPS
> University of Amsterdam
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel

Thanks for your report, could you paste/attach the code of your
extension module?
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug report: building an extension with --pyrex-gdb fails

2011-12-17 Thread Lars Buitinck
2011/12/17 mark florisson :
> Thanks for your report, could you paste/attach the code of your
> extension module?

The code is online at https://github.com/larsmans/sortedcollection

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug report: building an extension with --pyrex-gdb fails

2011-12-17 Thread mark florisson
On 17 December 2011 12:57, Lars Buitinck  wrote:
> 2011/12/17 mark florisson :
>> Thanks for your report, could you paste/attach the code of your
>> extension module?
>
> The code is online at https://github.com/larsmans/sortedcollection
>
> --
> Lars Buitinck
> Scientific programmer, ILPS
> University of Amsterdam
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel

Thanks, that was very helpful. The problem was that generator
functions apparently don't fill out a name in the symbol table. You
can try again from this branch:
https://github.com/markflorisson88/cython/commit/ed648d932f3922f77e140a6292d65f56f4899090
which will be pushed to cython's master branch later.
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] Merging of the ctypes backend branch

2011-12-17 Thread Romain Guillebert
Hi everyone

I rebased the ctypes backend branch to the last cython commit, and I
wondered how the branch should be merged with the main cython
repository. I see 3 options : a) upload the branch without merging it b)
merge the branch but not run the test suite on ctypes by default or c)
merge the branch and run the test suite.

I think it's better to do c) but the test results shouldn't mix with the
results of the other backends.

What do you think ?

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