[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed ___ Python tracker ___

[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset ca4bf8e10bc0 by Brett Cannon in branch 'default': Issue #15316: Let exceptions raised during imports triggered by the http://hg.python.org/cpython/rev/ca4bf8e10bc0 -- nosy: +python-dev ___ Python tracker

[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon
Brett Cannon added the comment: I am running the test suite now using the "secret" attribute on ImportError. I tried to pass a flag, but locking became a bit messy/complicated. And I also realized that if I didn't do this then using different implementation of import_ in importlib wouldn't wor

[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon
Brett Cannon added the comment: It will get fixed today. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Georg Brandl
Georg Brandl added the comment: I don't agree that this is a blocker; would be nice to fix it, of course. -- priority: release blocker -> critical ___ Python tracker ___

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Eric Snow
Eric Snow added the comment: > While I prefer 3, I think it's a bit late in the release to try to > introduce a new exception to begin separating the meaning of 16 > different ``raise ImportError`` cases in importlib._bootstrap based on > inheritance. My gut says 4 is the best solution given the

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: You're welcome, Brett. I'll let you or someone else recast the test using the latest preferred techniques. I was just using the style of the immediately surrounding tests. -- ___ Python tracker

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the test, Chris. It can probably be simplified using the utilities in test_importlib (e.g. managing the cleanup of sys.path, using mocked loaders to raise the exception instead of having to write to the file system, etc.), but otherwise the idea of th

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Here is a formal unit test case that passes in 3.2 but not in 3.3 (a "simpler" case not using __main__.py). (script_helper.create_empty_file() doesn't seem to be available in 3.2.) -- keywords: +patch Added file: http://bugs.python.org/file26967/issue-

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Brett Cannon
Brett Cannon added the comment: It has nothing to do with runpy and __main__.py and everything to do with rev 78619:0d52f125dd32 (which fixed issue #15715) which was done to ignore bogus names in fromlist. If you simply change the import line to "import foo.bar" then you get the expected resul

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Jeff Knupp
Changes by Jeff Knupp : -- nosy: +Jeff.Knupp ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Should this issue be fixed before the release? If it is not fixed, certain problems found after the release may become harder to report and diagnose (because the true source of error will be masked). Two months ago issue 15111 which was thought to be the same

[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- keywords: +3.2regression ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek
Chris Jerdonek added the comment: I ran into this again because an error while running `./python.exe -m test` was getting masked. The use of __main__.py in the package may be the distinguishing characteristic. -- ___ Python tracker

[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek
Chris Jerdonek added the comment: I randomly ran into this issue again. I'm not sure this was ever resolved (i.e. I think it may always have been different from issue 15111). I still get the above behavior in the default branch. And here is what I get in the 3.2 branch (the error information

[issue15316] runpy swallows ImportError information with relative imports

2012-07-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Looks very similar to issue15111. -- nosy: +amaury.forgeotdarc resolution: -> duplicate status: open -> closed superseder: -> Wrong ImportError message with importlib ___ Python tracker

[issue15316] runpy swallows ImportError information with relative imports

2012-07-09 Thread Chris Jerdonek
New submission from Chris Jerdonek : With the following package directory structure-- foo/ __init__.py __main__.py from foo import bar bar.py print('***') raise ImportError('test...') Running-- $ ./python.exe -m foo Yields-- *** Traceback (most recent call