Issue #12 invalid

Problem executing samples with Python 2.7.3

Anonymous avatarAnonymous created an issue

Trying to execute the samples sample1.py and sample2.py in the samples folders with a freshly installed Python 2.7.3 (Windows 7 Pro, 64Bit) produces an error (on my machine):

Failed example:
    f = parse("int f(int a, long b) { do_this; do_that; }", Function, comment=comment_c)
Exception raised:
    Traceback (most recent call last):
      File "c:\Python27\lib\doctest.py", line 1289, in __run  compileflags, 1) in test.globs
      File "<doctest __main__[0]>", line 1, in <module>
        f = parse("int f(int a, long b) { do_this; do_that; }", Function, comment=comment_c)
      File "c:\Python27\lib\site-packages\pypeg2\__init__.py", line 563, in parse t, r = parser.parse(text, thing)
...
      File "c:\Python27\lib\site-packages\pypeg2\__init__.py", line 837, in _parse for i in range(_max):
    OverflowError: Python int too large to convert to C long
**********************************************************************
1 items had failures:
  12 of  20 in __main__
***Test Failed*** 12 failures.

Perhaps this happens due to my stupidity, perhaps it's worth looking into it closer, I just thought it might be useful to let you know.

Jannico

Comments (3)

  1. Volker Birk

    Something else seems to go wrong, because here it works:

    vb@bayhorse:~/pyPEG2 % PYTHON=python2.7 make -e test
    PYTHONPATH=`pwd` python2.7 pyPEG2/test/test_pyPEG2.py
    ...........................................
    ----------------------------------------------------------------------
    Ran 43 tests in 0.009s
    
    OK
    PYTHONPATH=`pwd` python2.7 pyPEG2/test/test_xmlast.py
    .....
    ----------------------------------------------------------------------
    Ran 5 tests in 0.002s
    
    OK
    PYTHONPATH=`pwd` python2.7 samples/sample1.py
    PYTHONPATH=`pwd` python2.7 samples/sample2.py
    vb@bayhorse:~/pyPEG2 % python2.7 --version
    Python 2.7.3
    vb@bayhorse:~/pyPEG2 %
    

    Could you please explain, with which command are you starting the samples?

  2. Volker Birk

    This looks like a Python implementation bug in your interpreter. In the code I'm using sys.maxsize – this is defined as the biggest number which fits in an int.

    By definition, this error should never occur.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.