Menu

#66 many failures when running examples in py3.3 pyparsing 2.0.0

open
nobody
None
5
2013-04-19
2013-04-19
No

when running the examples shipped with pyparsing 2.0.0 many fail with errors that look like possible bugs in pyparsing.

Attached a log of running all. failing files start with "FAIL " followed by the filename.
many are probably due to missing internet connection, but these failures occur inside pyparsing.py and may be bugs:

gen_ctypes.py
htmlStripper.py
parseListString.py
parsePythonValue.py
partial_gene_match.py
stackish.py
wordsToNum.py

e.g.:
gen_ctypes.py:46: SyntaxWarning: Invalid argument to oneOf, expected string or list
primitiveType = oneOf(t for t in typemap if not t.endswith("*"))
Traceback (most recent call last):
File "gen_ctypes.py", line 46, in <module>
primitiveType = oneOf(t for t in typemap if not t.endswith("*"))
File "/pyparsing.py", line 3111, in oneOf
while i < len(symbols)-1:

Discussion

  • Julian Taylor

    Julian Taylor - 2013-04-19
     
  • Anonymous

    Anonymous - 2013-04-19

    I just made a spot check, and most of these problems occur also with Python 2.7 and pyparsing 1.5.7. I only confirmed as failing with 2.7/1.5.7: configParse, htmlStripper, makeHTMLTagExample, parseListString, removeLineBreaks, stackish, test_bibparse and wordsToNum.
    excelExpr, greetingInKorean, httpServerLogParser, parsePythonValue, searchParserAppDemo, searchparser, sexpParser, sparser imported/ran without a problem.
    partial_gene_match, scanYahoo, urlExtractor, urlExtractorNew failed for me, but that might be due to network proxy issues.

     
  • Anonymous

    Anonymous - 2013-04-19

    I forgot to mention that I think most of them are failing not due to problems in pyparsing itself,
    but due to expectations on the part of the examples, many of which are contributed.

    For example, a couple of them refer to modules that aren't part of pyparsing (nose, sets),
    some expect the ability to get to an URL, some expect additional files to be available
    in the working directory (setup.ini, 'Successful Methods...text', verilog) and some
    expect Unicode characters to be available on the console.

    The parseListString has a problem with the grammar vs the input being provided.

    The parsePythonValue grammar has a setParseAction that won't work (as is) on Python 3.

    The removeLineBreaks is using the pre-Python 3 way of opening a file with the 'file' method, instead of 'open'.

    Of the ones I ran that didn't require network access, I'm not sure about whether
    these are pyparsing or example issues:
    gen_ctypes: "UnboundLocalError: local variable 'symbols' referenced before assignment"
    httpServerLogParser: AttributeError: 'module' object has no attribute 'uppercase'
    partial_gene_match: TypeError: 'in <string>' requires string as left operand, not int

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.