[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Eric Snow
Eric Snow added the comment: I've taken the tanget over to issue15720. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Brett Cannon
Brett Cannon added the comment: We might be able to hide it in Python 3 since importlib.import_module() has been available since Python 3.1 (and 3.0 is dead anyway). -- ___ Python tracker _

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Eric Snow
Eric Snow added the comment: When people want to import modules with "runtime" names, they regrettably turn to __import__() and likely will for a while. What a source of headaches! If it were less convenient to use __import__(), perhaps fewer people would use it. Could we remove it from .__b

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d52f125dd32 by Brett Cannon in branch 'default': Issue #15715: Ignore failed imports triggered by the use of fromlist. http://hg.python.org/cpython/rev/0d52f125dd32 -- nosy: +python-dev ___ Python tracke

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-17 Thread Brett Cannon
Brett Cannon added the comment: And this is why we have said people should use the idiom of ``__import__('http.blah'); mod = sys.modules['http.blah']`` if importlib is not used (which is on PyPI and works as far back as Python 2.3), else you will deal with an AttributeError later instead of an

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Georg Brandl
Georg Brandl added the comment: I agree that we should match 3.2 behavior here. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Eric Snow
Eric Snow added the comment: The following seems to indicate that an ImportError should be raised as expected. I'm guessing that somewhere along the line the exception gets silently eaten. -- (3.2) Python/import.c:ensure_fromlist() [1] submod = import_submodule(m

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Eric Snow
Eric Snow added the comment: Here's a simple patch the allows bogus names in the fromlist. I'm going to verify that this matches the 3.2 semantics, which may not be so cut-and-dry. -- keywords: +patch Added file: http://bugs.python.org/file26876/issue15715.diff ___

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Eric Snow
Eric Snow added the comment: The failure output with -v: ... # /home/esnow/projects/cpython/Lib/http/__pycache__/__init__.cpython-33.pyc matches /home/esnow/projects/cpython/Lib/http/__init__.py # code object from /home/esnow/projects/cpython/Lib/http/__pycache__/__init__.cpython-33.pyc import

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Unless it is difficult to fix, I think this regression should be addressed before 3.3 final. Georg? -- components: +Interpreter Core, Library (Lib) -None nosy: +pitrou priority: normal -> release blocker stage: -> needs patch _

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
Simon Feltman added the comment: Should have been "...Python 2.5 which it looks like importlib is NOT available." -- ___ Python tracker ___ __

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
Simon Feltman added the comment: I think pygobject still supports Python 2.5 which it look like importlib is available. I've submitted a patch to pygobject which will work regardless of if this regression is fixed or not: https://bugzilla.gnome.org/show_bug.cgi?id=682051 -- _

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Eric Snow
Eric Snow added the comment: While this is a regression, 3.3 definitely puts an increased emphasis on using importlib.import_module() instead of builtins.__import__(). Any reason why import_module() isn't used? As to the regression, while the current behavior makes more sense, it is contrary

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
Changes by Simon Feltman : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
New submission from Simon Feltman: This came up while trying to build pygobject with Python 3.3. The problem is there are some erroneous imports in the fromlist with these bindings that can easily be fixed. But it is a behavioral change so I just wanted to raise awareness if it is not already