ned14 / pcpp

A C99 preprocessor written in pure Python
Other
222 stars 41 forks source link

crash when using tool #70

Open SourceCodeDeleted opened 2 years ago

SourceCodeDeleted commented 2 years ago

Hello this crashed when I use it. I wonder if it is out of date for the latest python because I was warned about the verbose argument not being supported

TypeError: namedtuple() got an unexpected keyword argument 'verbose'

I commented these out and now I receive the following when I run that application.

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/cpip/core/PpLexer.py", line 554, in _genPpTokensRecursive
    myTtt = next(theGen)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "CPIPMain.py", line 1562, in <module>
    sys.exit(main())
  File "CPIPMain.py", line 1532, in main
    result = preprocessFileToOutput(inPath, args.output, jobSpec)
  File "CPIPMain.py", line 1287, in preprocessFileToOutput
    myTokCntr, mySetItuLines = Tu2Html.processTuToHtml(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/cpip/Tu2Html.py", line 177, in processTuToHtml
    for t in theLex.ppTokens(incWs=True, minWs=True, condLevel=theCondLevel):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/cpip/core/PpLexer.py", line 451, in ppTokens
    for aTok in self._genPreIncludeTokens():
  File "/home/ubuntu/.local/lib/python3.8/site-packages/cpip/core/PpLexer.py", line 358, in _genPreIncludeTokens
    for aTok in self._genPpTokensRecursive(myGen):
RuntimeError: generator raised StopIteration

Is this a known issue ? Is there more which I can do ? Is this supported still?

ned14 commented 2 years ago

TBH I'm still on Python 3.7 personally, so I'd never see any breakages from newer Pythons. Can you perhaps give a clearer exact repro for me to execute to replicate the problem?

assarbad commented 2 years ago

@SourceCodeDeleted could you specify the version (or Git rev) with which you encountered this? I have locally set up Python 2.7 and 3.7 through 3.11 using pyenv and I am not getting anything like that when running the tests or the code from master (2ad25f10d358d85dcb3c5dfc358980a6cd008165, and fbc7a3cbc6e57d18462453dc65ba2c985fd6ac21 for ply). I only tested python3.8 -m pcpp.pcmd, though (but all tests across _all Python versions).

In fact I don't even see a reference to namedtuple. So where are you getting that?

assarbad commented 2 years ago

Wait a minute, @SourceCodeDeleted ... I think you picked the wrong project to report your issue. After taking a closer look at the paths in your stacktrace I think you meant to report this over here. E.g. the first mentioned file in your case - cpip/core/PpLexer.py - seems to refer to this file.

@ned14 I think this can be closed no matter what.

assarbad commented 2 years ago

@ned14 this ticket can be closed. It doesn't refer to your project, even.