#44 python3-only packrat error

v1.0 (example)
closed-fixed
nobody
None
5
2016-09-10
2011-07-28
No

Only in Python3:

>>> import pyparsing
>>> pyparsing.__version__
'1.5.6'
>>> grammar = pyparsing.pythonStyleComment ^ pyparsing.cStyleComment
>>> grammar.parseString('/* hi */')
(['/* hi */'], {})
>>> pyparsing.ParserElement.enablePackrat()
>>> grammar.parseString('/* hi */')
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 890, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 837, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 1687, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pyparsing.ParseException: Expected Python style comment (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 959, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 890, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 833, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 2260, in parseImpl
loc2 = e.tryParse( instring, loc )
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 875, in tryParse
return self._parse( instring, loc, doActions=False )[0]
File "/usr/local/Cellar/python3/3.2/lib/python3.2/site-packages/pyparsing-1.5.6-py3.2.egg/pyparsing.py", line 894, in _parseCache
exc.__traceback__ = None
NameError: global name 'exc' is not defined

Discussion

  • Paul McGuire

    Paul McGuire - 2012-06-16
    • status: open --> pending-fixed
     
  • Paul McGuire

    Paul McGuire - 2012-06-16

    Thanks Catherine - the fixed version is checked into SVN, will be in the next release.

     
  • Paul McGuire

    Paul McGuire - 2016-09-10
    • status: pending-fixed --> closed-fixed
    • Group: --> v1.0 (example)
     
  • Paul McGuire

    Paul McGuire - 2016-09-10

    Cleaning up old bug reports - this bug has been addressed and released.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks