classification
Title: regression for importing extensions in packages
Type: behavior Stage: resolved
Components: Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder: PEP 489 -- Multi-phase extension module initialization
View: 24268
Assigned To: Nosy List: brett.cannon, encukou, eric.snow, ncoghlan, python-dev, ronaldoussoren
Priority: high Keywords:

Created on 2015-05-25 12:04 by ronaldoussoren, last changed 2015-05-26 11:58 by ncoghlan. This issue is now closed.

Files
File name Uploaded Description Edit
issue-24285.txt ronaldoussoren, 2015-05-25 12:07 review
Messages (5)
msg244030 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2015-05-25 12:04
PyObjC has an extension that's imported as "objc._objc". This works fine on version upto the 3.5 beta (checkout from earlier today).

With that I get the following exception:

Python 3.5.0b1+ (default:7255af1a1c50+, May 25 2015, 11:46:18) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ronald/Projects/pyobjc-hg/pyobjc/pyobjc-core/Lib/objc/__init__.py", line 18, in <module>
    _update()
  File "/Users/ronald/Projects/pyobjc-hg/pyobjc/pyobjc-core/Lib/objc/__init__.py", line 15, in _update
    import objc._objc as _objc
ImportError: dynamic module does not define module export function (PyInit_._objc)
msg244031 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2015-05-25 12:07
The attached patch appears to fix the issue. This appears to be an off-by-one error.
msg244035 - (view) Author: Petr Viktorin (encukou) * Date: 2015-05-25 13:47
issue 24268 has a patch with a test case.
msg244098 - (view) Author: Roundup Robot (python-dev) Date: 2015-05-26 11:57
New changeset 55e6f3f94b99 by Nick Coghlan in branch '3.5':
Issue #24285: fix importing extensions from packages
https://hg.python.org/cpython/rev/55e6f3f94b99

New changeset 32ee7b9d58c9 by Nick Coghlan in branch 'default':
Merge fix for issue #24285 from 3.5
https://hg.python.org/cpython/rev/32ee7b9d58c9
msg244099 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2015-05-26 11:58
Since this error was in the beta release, I used this issue reference in the NEWS file, rather than the original implementation issue.
History
Date User Action Args
2015-05-26 11:58:35ncoghlansetresolution: duplicate -> fixed
messages: + msg244099
2015-05-26 11:57:42python-devsetnosy: + python-dev
messages: + msg244098
2015-05-25 21:22:20berker.peksagsetstatus: open -> closed
superseder: PEP 489 -- Multi-phase extension module initialization
resolution: duplicate
stage: needs patch -> resolved
2015-05-25 13:47:52encukousetnosy: + encukou
messages: + msg244035
2015-05-25 12:07:21ronaldoussorensetfiles: + issue-24285.txt
type: behavior
messages: + msg244031

stage: needs patch
2015-05-25 12:04:49ronaldoussorencreate