[New-bugs-announce] [issue4048] parsermodule won't validate relative imports

David Binger report at bugs.python.org
Mon Oct 6 00:15:20 CEST 2008


New submission from David Binger <davidbinger at mac.com>:

The parser module validates st instances that it builds from 
list or tuple structures.  This validation fails for parse
trees that include relative imports because it fails to correctly
count the dots that immediately follow the "from" token.

Here is a test and a patch.

This bug probably extends back to all Python 2 versions that support
relative import, but I have not checked it.

Fixing this has immediate value to me because the QPY package 
depends on the parser module to convert list structures into st 
instances.  (In the long run, I wonder if the verification
part of the sequence2st() function could be made optional or dropped,
since the current pattern requires to parser module to be updated
every time the language grammer changes.)

----------
components: Library (Lib)
files: parserdot.diff
keywords: patch
messages: 74354
nosy: dbinger
severity: normal
status: open
title: parsermodule won't validate relative imports
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file11705/parserdot.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4048>
_______________________________________


More information about the New-bugs-announce mailing list