This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Parser module fails on short relative imports
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: mark.dickinson
Priority: normal Keywords: patch

Created on 2010-06-30 19:31 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
parser_relative_imports.patch mark.dickinson, 2010-06-30 19:31
Messages (4)
msg109006 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-06-30 19:31
Python 2.7rc2+ (trunk:82399M, Jun 30 2010, 17:10:13) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import parser
[35303 refs]
>>> parser.sequence2st(parser.suite("from . import me").totuple())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
parser.ParserError: VALIDATION FAILURE: report this to the maintainer!
[35341 refs]

Patch attached.
msg109007 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-06-30 19:35
With this patch, and the one in issue 9128, the parser module roundtrips correctly on all Lib/*.py and all Lib/test/*.py files (except for Lib/test/bad*.py).  Tested by doing:

./python.exe Demo/parser/test_parser.py Lib/*.py

and

./python.exe Demo/parser/test_parser.py Lib/test/*.py

(the latter after deleting the Lib/test/bad*.py files)
msg109252 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-04 18:19
Fixed in revisions r82543, r82546, r82552, r82553, r82554.

Leaving open because I'm suspicious that the parser module isn't handling relative imports with more than three dots correctly in py3k (since ... gets parsed as an ellipsis token).
msg109253 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-04 18:40
Ellipsis token validation fixed in r82555 (py3k), r82556 (release31-maint).
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53376
2010-07-04 18:40:56mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg109253

stage: commit review -> resolved
2010-07-04 18:19:39mark.dickinsonsetmessages: + msg109252
2010-06-30 19:35:03mark.dickinsonsetmessages: + msg109007
2010-06-30 19:31:05mark.dickinsoncreate