Opened 6 years ago

Closed 6 years ago

#117 closed defect (fixed)

Buffer typedefs raises parser exception

Reported by: dagss Owned by: dagss
Priority: major Milestone: 0.11
Component: Parsing Keywords: buffer numerics
Cc:

Description

Uwe Schmitt:

Hi,

I got a problem with the following typedef

   ctypedef  np.ndarray[np.double_t, ndim=1, negative_indices=False, mode="c"] ndarray

results in

    Traceback (most recent call last):
      File "setup.py", line 24, in <module>
        ext_modules= [  ext1,],
      File "C:\Python25\lib\distutils\core.py", line 151, in setup
        dist.run_commands()
      File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
        self.run_command(cmd)
      File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
        cmd_obj.run()
      File "C:\Python25\lib\distutils\command\build_ext.py", line 290, in run
        self.build_extensions()
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Distuti
    ls\build_ext.py", line 81, in build_extensions
        ext.sources = self.cython_sources(ext.sources, ext)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Distuti
    ls\build_ext.py", line 196, in cython_sources
        full_module_name=module_name)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 690, in compile
        return compile_single(source, options, full_module_name)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 635, in compile_single
        return run_pipeline(source, options, full_module_name)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 524, in run_pipeline
        err, enddata = context.run_pipeline(pipeline, source)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 183, in run_pipeline
        data = phase(data)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 482, in parse
        tree = context.parse(source_desc, scope, pxd = 0, full_module_name = full_mo
    dule_name)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Main.py", line 414, in parse
        tree = Parsing.p_module(s, pxd, full_module_name)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Parsing.py", line 2414, in p_module
        body = p_statement_list(s, Ctx(level = level), first_statement = 1)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Parsing.py", line 1480, in p_statement_list
        stats.append(p_statement(s, ctx, first_statement = first_statement))
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Parsing.py", line 1411, in p_statement
        return p_ctypedef_statement(s, ctx)
      File "c:\python25\lib\site-packages\cython-0.10-py2.5-win32.egg\Cython\Compile
    r\Parsing.py", line 2182, in p_ctypedef_statement
        if base_type.name is None:
    AttributeError: 'CBufferAccessTypeNode' object has no attribute 'name'

Is this a bug ?}}}

Yes, it is. Ideally one should add this as a feature, but at least it should give a better error message.

Change History (6)

comment:1 Changed 6 years ago by robertwb

  • Milestone changed from 0.10.1 to 0.11

comment:3 Changed 6 years ago by dagss

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 6 years ago by scoder

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed 6 years ago by scoder

  • Owner changed from somebody to dagss
  • Status changed from reopened to new

comment:6 Changed 6 years ago by scoder

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.