Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Python-bugs-list mailing list
Nick Coghlan added the comment:
Indeed, there are still a couple of Windows failures, but they aren't related
to this.
--
status: pending - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
Eric Snow added the comment:
For instance,
http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/7214/steps/test/logs/stdio
4 cases of ImportError: No module named '_parent_foo'. Failing on import
_parent_foo.bar and from _parent_foo import bar.
Unfortunately I don't have an XP
Roundup Robot added the comment:
New changeset 8a0eb395e725 by Nick Coghlan in branch 'default':
Issue #15425: Don't rely on the assumption that the current working directory
is on sys.path (this will hopefully appease the XP buildbots)
http://hg.python.org/cpython/rev/8a0eb395e725
--
Changes by Nick Coghlan ncogh...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Python-bugs-list
Eric Snow added the comment:
Looks like both XP buildbots are happy now. (one is failing, but not for
test_import).
--
status: pending - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Antoine Pitrou added the comment:
For some reason the new tests fail on the XP buildbots.
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Changes by Nick Coghlan ncogh...@gmail.com:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Python-bugs-list
Nick Coghlan added the comment:
Added patch with test cases for the situations Amaury picked up, as well
another I noticed (when the from clause refers to a module that fails)
--
Added file: http://bugs.python.org/file26564/issue15425_test_cases.diff
Nick Coghlan added the comment:
I actually did start refactoring a lot of this when I was working on the
pkgutil changes, but stopped because that patch was already hairy enough.
Maybe I should have kept going...
--
___
Python tracker
Nick Coghlan added the comment:
I think tuning the what frames to hide heuristic is a better bet - I remember
know that the real reason I stopped messing with which exceptions were thrown
was that I ended up confusing pkgutil.
--
___
Python tracker
Nick Coghlan added the comment:
Fixed test case patch - previous one included a comment from when my test was
buggy.
--
Added file: http://bugs.python.org/file26565/issue15425_test_cases.diff
___
Python tracker rep...@bugs.python.org
Changes by Nick Coghlan ncogh...@gmail.com:
Removed file: http://bugs.python.org/file26564/issue15425_test_cases.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Amaury Forgeot d'Arc added the comment:
I like the concept of exit points that Antoine introduced with a special
method name. Maybe we coule generalize this and have a
execute_and_hide_frames(func, *args, **kwargs) that is recognized by the
caller in import.c.
--
Nick Coghlan added the comment:
OK, to investigate the failures a bit further, I turned off the traceback
suppression altogether by sticking an immediate return at the start of
remove_importlib_frames. For the three failing tests, this is what I got when
adding a traceback.print_tb call:
Nick Coghlan added the comment:
I realised that it is my test that was wrong in the syntax error case. Attached
patch includes the test cases, and the fix for that case.
The weird thing that still requires an explanation is why the chunks in the
first two cases are only being partially
Nick Coghlan added the comment:
Ah, it turns out the three problem children are those which accept an import_
callback, which is set to builtins.__import__ when accessed via the import
statement. This means we end up making a *recursive* call to
PyImport_ImportModuleLevelObject, which calls
Nick Coghlan added the comment:
I'll at least introduce a _recursive_import exit point to simplify handling
of those three cases. For those, if there isn't another importlib frame on the
stack below them, odds are pretty good that it has been stripped already.
--
Nick Coghlan added the comment:
I think the implementation I just checked in is close to being as simple as we
can get:
Blocks ending in _exec_module and _recursive_import are trimmed unconditionally
For SyntaxError, it also trims blocks ending in get_code
For ImportError, it trims everything
Roundup Robot added the comment:
New changeset 75a30a478dc7 by Nick Coghlan in branch 'default':
Close #15425: Eliminate more importlib related traceback noise
http://hg.python.org/cpython/rev/75a30a478dc7
--
nosy: +python-dev
resolution: - fixed
stage: - committed/rejected
status:
Nick Coghlan added the comment:
On second thought, I realised having a general purpose hide this hook means
that any future unconditional cases can easily be hidden just by changing from
the normal call to a stripped call. I'll implement that now.
--
Nick Coghlan added the comment:
Seeing as the blocker is dealt with for beta2, see #15486 for the proposed
refactoring.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Chris Jerdonek added the comment:
The unit tests added here are another candidate for the refactoring in issue
15403 (Refactor package creation support code into a common location). I'll
note this in that issue.
--
nosy: +cjerdonek
___
Python
Amaury Forgeot d'Arc added the comment:
IMO we should not ship 3.3 without a fix for this.
--
priority: normal - high
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Changes by Georg Brandl ge...@python.org:
--
priority: high - release blocker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Eric Snow added the comment:
Perhaps this should be split into two issues, as the fix will likely be
different for the two.
For the first part (SyntaxError), my initial impression is that this will
require a similar fix, or extension of it, to the one in issue15110. That fix
was limited
Eric Snow added the comment:
Here's a trivial patch that demonstrates what I mean. Yet, in light of
exception chaining, I wonder if we should consider actually making ImportError
supercede the inner exception. I'll still try coming up with something
similar, but propagates the inside
New submission from Amaury Forgeot d'Arc amaur...@gmail.com:
Two easy ways to get tracebacks which contain useless importlib._bootstrap
rows:
- When there is a syntax error in the imported module
- On import package.module, when top-level package cannot be imported
$ ./python -c import foo
32 matches
Mail list logo