robertwb / issues-import-test

0 stars 0 forks source link

The following code causes mysterious exceptions #67

Closed robertwb closed 7 years ago

robertwb commented 7 years ago

Reported by gfurnish on 2 Aug 2008 08:08 UTC 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.

Migrated-From: http://trac.cython.org/ticket/35

robertwb commented 7 years ago

Comment by robertwb on 3 Aug 2008 06:38 UTC See http://hg.cython.org/cython-devel/rev/7a1defb8455d

robertwb commented 7 years ago

Modified by robertwb on 19 Aug 2008 04:35 UTC