[Python-bugs-list] [ python-Bugs-678518 ] Another parsermodule validation error

SourceForge.net noreply@sourceforge.net
Mon, 03 Feb 2003 03:00:44 -0800


Bugs item #678518, was opened at 2003-02-01 02:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678518&group_id=5470

Category: Parser/Compiler
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: logistix (logistix)
>Assigned to: Michael Hudson (mwh)
Summary: Another parsermodule validation error

Initial Comment:
The following code generates an validation error.  It's an 
invalid ast tree where the global_stmt doesn't have the 
keyword 'global' as a child.

I tracked down the fix to validate_global_stmt() this time.

Python 2.3a1 (#38, Dec 31 2002, 17:53:59) [MSC 
v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import symbol,token,parser
>>> ast = [symbol.file_input,
...  [symbol.stmt, [symbol.simple_stmt, 
[symbol.small_stmt, [symbol.global_stmt,
 [1, 'foo']]], [token.NEWLINE, '']]],
...  [token.NEWLINE, ''],
...  [token.ENDMARKER, '']]
>>> a = parser.sequence2ast(ast)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
parser.ParserError: VALIDATION FAILURE: report this 
to the maintainer!
>>>

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2003-02-03 11:00

Message:
Logged In: YES 
user_id=6656

Thanks for doing this.  I'll probably check these in after
I've finished crunching my way through monday morning email...

----------------------------------------------------------------------

Comment By: logistix (logistix)
Date: 2003-02-01 21:42

Message:
Logged In: YES 
user_id=699438

And I found a few more by doing a roundtrip 
ast2Tuple/tuple2ast on all files in pythonpath.  These actually 
affect valid AST's, so they're probably a bigger deal.

Valid assert statements were failing.  The patch was trivial, 
so its attached.

Also, files that took advantage of encoding_decl (from PEP 
263) were failing.  I couldn't tell if PEP 263 was offically 
closed, and didn't know what the offical grammar was, so I 
didn't do anything there.

I'll also attach the test script that turned up these errors.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678518&group_id=5470