[issue23773] importlib does not properly remove frames when invoking external import hooks

2016-09-08 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: brett.cannon -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-04-13 Thread Brett Cannon

Brett Cannon added the comment:

Did you happen to run the test suite with this change, Shiz? There's actually a 
test to make sure that the part of the traceback you're avoiding isn't lost in 
case there's a bug in importlib itself.

Can you show that your change won't actually affect finding errors in importlib 
itself?

--
nosy: +eric.snow, ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-04-13 Thread Raúl Cumplido

Changes by Raúl Cumplido raulcumpl...@gmail.com:


--
nosy: +raulcd

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-04-13 Thread Shiz

Shiz added the comment:

Ah, that is a very good point. I'll run the suite as soon as I find the time 
and will report back.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-03-25 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +brett.cannon
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-03-25 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-03-24 Thread Shiz

New submission from Shiz:

When adding a custom module loader to sys.meta_path, importlib does not 
properly remove its frames before invoking it. This results in a weird 
traceback with importlib._bootstrap frames in if an error occurs during 
load_module(), like such:

Traceback (most recent call last):
  File /Users/mark/Development/Projects/rave/rave/bootstrap/__init__.py, line 
102, in bootstrap_game
__import__(MODULE_PACKAGE + '.' + mod.replace('.py', ''))
  File frozen importlib._bootstrap, line 2237, in _find_and_load
  File frozen importlib._bootstrap, line 2226, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 1200, in _load_unlocked
  File frozen importlib._bootstrap, line 1129, in _exec
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/__init__.py, line 1, in module
from . import common, core3
  File frozen importlib._bootstrap, line 2237, in _find_and_load
  File frozen importlib._bootstrap, line 2226, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 1200, in _load_unlocked
  File frozen importlib._bootstrap, line 1129, in _exec
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/core3/__init__.py, line 11, in module
from .texture import Texture, Image
  File frozen importlib._bootstrap, line 2237, in _find_and_load
  File frozen importlib._bootstrap, line 2226, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 1200, in _load_unlocked
  File frozen importlib._bootstrap, line 1129, in _exec
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/core3/texture.py, line 8, in module
raise ValueError

Attached is a patch against the current hg head that makes sure module loaders 
are invoked through _call_with_frames_removed, so that the output becomes a lot 
more readable:

Traceback (most recent call last):
  File /Users/mark/Development/Projects/rave/rave/bootstrap/__init__.py, line 
102, in bootstrap_game
__import__(MODULE_PACKAGE + '.' + mod.replace('.py', ''))
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/__init__.py, line 1, in module
from . import common, core3
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/core3/__init__.py, line 11, in module
from .texture import Texture, Image
  File /Users/mark/Development/Projects/rave/rave/modularity.py, line 23, in 
exec_module
super().exec_module(module)
  File /.modules/opengl/core3/texture.py, line 8, in module
raise ValueError
ValueError

Ideally it would remove the calls /within/ the module loader itself too, but I 
do not see an easy way to do this without changing the entire 
_call_with_frames_removed semantics. This fixes most of the issues, though.

--
components: Library (Lib)
files: cpython-3ac58de829ef-fix-external-module-loader-call-traceback.patch
keywords: patch
messages: 239219
nosy: shiz
priority: normal
severity: normal
status: open
title: importlib does not properly remove frames when invoking external import 
hooks
type: behavior
versions: Python 3.4, Python 3.5
Added file: 
http://bugs.python.org/file38681/cpython-3ac58de829ef-fix-external-module-loader-call-traceback.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23773
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com