Skip to content

extension API broken in python 2.7 #95

@soumith

Description

@soumith
  1. FileExistsError is not present in 2.7. Workaround: http://stackoverflow.com/questions/20790580/python-specifically-handle-file-exists-exception
  2. this occurs after fixing 1.
Traceback (most recent call last):
  File "build.py", line 7, in <module>
    with_cuda=False
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 127, in compile_extension
    ffi.cdef(_typedefs + header_source);
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/api.py", line 105, in cdef
    self._cdef(csource, override=override, packed=packed)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/api.py", line 119, in _cdef
    self._parser.parse(csource, override=override, **options)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 299, in parse
    self._internal_parse(csource)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 304, in _internal_parse
    ast, macros, csource = self._parse(csource)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 260, in _parse
    ast = _get_parser().parse(csource)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 40, in _get_parser
    _parser_cache = pycparser.CParser()
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/pycparser/c_parser.py", line 87, in __init__
    outputdir=taboutputdir)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/pycparser/c_lexer.py", line 66, in build
    self.lexer = lex.lex(object=self, **kwargs)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/pycparser/ply/lex.py", line 911, in lex
    lexobj.readtab(lextab, ldict)
  File "/Users/soumith/anaconda/lib/python2.7/site-packages/pycparser/ply/lex.py", line 233, in readtab
    titem.append((re.compile(pat, lextab._lexreflags | re.VERBOSE), _names_to_funcs(func_name, fdict)))
  File "/Users/soumith/anaconda/lib/python2.7/re.py", line 194, in compile
    return _compile(pattern, flags)
  File "/Users/soumith/anaconda/lib/python2.7/re.py", line 249, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/Users/soumith/anaconda/lib/python2.7/sre_compile.py", line 583, in compile
    "sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions