[issue15110] strange Tracebacks with importlib

2012-07-28 Thread Eric Snow
Eric Snow added the comment: Issue15425 is related. I'm looking into an exception chaining approach that could be applied for this issue too. -- nosy: +eric.snow ___ Python tracker ___

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5d43154d68a8 by Amaury Forgeot d'Arc in branch 'default': Issue #15110: Copy same docstring as other '_exec_module' methods. http://hg.python.org/cpython/rev/5d43154d68a8 -- ___ Python tracker

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 37e68da59047 by Amaury Forgeot d'Arc in branch 'default': Issue #15110: Also hide importlib frames when importing a builtin module fails. http://hg.python.org/cpython/rev/37e68da59047 -- ___ Python track

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I really like the "_exec_module" trick, but it should be applied to > builtin modules as well. I hacked _sre.c and got: I hadn't thought about this one. Can you apply your patch? -- ___ Python tracker

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Brett Cannon
Brett Cannon added the comment: Re-opening so Antoine can look at Amaury's proposed fix for builtin modules. -- status: closed -> open ___ Python tracker ___ ___

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I really like the "_exec_module" trick, but it should be applied to builtin modules as well. I hacked _sre.c and got: ~/python/cpython3.x$ ./python Traceback (most recent call last): File "/home/amauryfa/python/cpython3.x/Lib/site.py", line 70, in

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks, Brett! -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8c877ad00bc4 by Antoine Pitrou in branch 'default': Issue #15110: Fix the tracebacks generated by "import xxx" to not show the importlib stack frames. http://hg.python.org/cpython/rev/8c877ad00bc4 -- nosy: +python-dev

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Brett Cannon
Changes by Brett Cannon : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Brett Cannon
Brett Cannon added the comment: Looks good to me. Go ahead and commit it. -- assignee: brett.cannon -> pitrou ___ Python tracker ___

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, right, here is an updated patch which also handles extension modules and frozen ones. -- Added file: http://bugs.python.org/file26312/trim_tb2.patch ___ Python tracker __

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: See also msg164937 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I added to _ssl.c: PyErr_SetString(PyExc_ValueError, "Just a test"); return NULL; Then I tried to import the module: ~/python/cpython3.x$ ./python -c "import ssl" Traceback (most recent call last): File "", line 1, in File "/home/amauryfa/p

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Does it work for extension modules? What do you mean? -- ___ Python tracker ___ ___ Python-bugs-

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Does it work for extension modules? -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way, it has to be done in C since tb_next can't be modified from Python code. -- ___ Python tracker ___ ___

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch with tests. Brett, what do you think? -- stage: -> patch review Added file: http://bugs.python.org/file26308/trim_tb.patch ___ Python tracker

[issue15110] strange Tracebacks with importlib

2012-07-01 Thread Georg Brandl
Georg Brandl added the comment: Setting to blocker for b2. -- priority: critical -> release blocker ___ Python tracker ___ ___ Python

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: About this proposal: > - trim errors raised when executing the code of an imported module (i.e. in > _LoaderBasics._load_module()) The exec() could be isolated in a distinctly-named submethod (e.g. _exec_module()), so that it is easy to detect it in a traceb

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Dave Malcolm
Changes by Dave Malcolm : -- nosy: +dmalcolm ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, you're right. But it could become confusing if some error is raised inside of importlib itself (not an ImportError, something else - perhaps a bug). So I would suggest the following: - trim ImportErrors - trim errors raised when executing the code of an im

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: No, the example above is a SyntaxError, and I claim the importlib frames should be removed as well. -- ___ Python tracker ___ __

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps at least the trimming should only be done for ImportErrors, then? -- ___ Python tracker ___ ___

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I tried to do it in importlib, with code like raise original_exception.with_traceback(trimmed_traceback) but the function containing this very line would always be part of the displayed stack trace. -- __

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: Wouldn't it be better to do it in pure Python in importlib itself? -- nosy: +pitrou ___ Python tracker ___

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15110] strange Tracebacks with importlib

2012-06-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch which removes "" frames from tracebacks. Tests are missing, but this gives good result on the few samples I tried. "python -v" does not suppress importlib frames. -- keywords: +patch Added file: http://bugs.python.org/file26158/

[issue15110] strange Tracebacks with importlib

2012-06-19 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue15110] strange Tracebacks with importlib

2012-06-19 Thread Georg Brandl
Georg Brandl added the comment: I agree that this is not helpful at all in the usual case, i.e. when you *don't* want to debug importlib. The one frame in actual user code (distutils in this case) in the middle is kind of hard to spot, but it is what you want to know. Note that Amaury's exa

[issue15110] strange Tracebacks with importlib

2012-06-19 Thread R. David Murray
R. David Murray added the comment: importlib is written in python. So you get a python traceback of its execution stack. Yes it is noisy, but I'm not sure that this should be changed, or we'd lose some of the benefit of having importlib written in python. (It also might be really complicat

[issue15110] strange Tracebacks with importlib

2012-06-19 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc : Exceptions during import now display huge tracebacks across importlib._bootstrap, this adds a lot of noise to the error: For example, I added some syntax error in distutils/spawn.py, then: ~/python/cpython3.x$ ./python -c "from distutils import ccompi