Ticket #35 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

The following code causes mysterious exceptions

Reported by: gfurnish Owned by: somebody
Priority: major Milestone: 0.9.8.1
Component: Parsing Keywords:
Cc:

Description

Consider:

cdef PyObject* fast_tp_alloc(RichPyTypeObject *t, Py_ssize_t):

This gives the following traceback

Traceback (most recent call last):
  File "/home/gfurnish/sage-3.0.6/local/bin/cython", line 8, in <module>
    main(command_line = 1)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 527, in main
    result = compile(sources, options)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 505, in compile
    return compile_multiple(source, options)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 472, in compile_multiple
    result = context.compile(source, options)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 327, in compile
    tree.process_implementation(scope, options, result)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 48, in process_implementation
    self.analyse_declarations(env)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 45, in analyse_declarations
    self.body.analyse_declarations(env)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 242, in analyse_declarations
    stat.analyse_declarations(env)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 986, in analyse_declarations
    name_declarator, type = self.declarator.analyse(base_type, env, self.body is not None)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 382, in analyse
    return self.base.analyse(ptr_type, env, nonempty = nonempty)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 434, in analyse
    name_declarator, type = arg_node.analyse(env, nonempty = nonempty)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 531, in analyse
    return self.declarator.analyse(base_type, env, nonempty = nonempty)
  File "/home/gfurnish/sage-3.0.6/local/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 344, in analyse
    self.name = base_type.name
AttributeError: CPySSizeTType instance has no attribute 'name'

This should give a more user friendly error.

Change History

Changed 5 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed

Changed 5 years ago by robertwb

  • milestone set to 0.9.8.1
Note: See TracTickets for help on using tickets.