Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression for importing extensions in packages #68473

Closed
ronaldoussoren opened this issue May 25, 2015 · 5 comments
Closed

regression for importing extensions in packages #68473

ronaldoussoren opened this issue May 25, 2015 · 5 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@ronaldoussoren
Copy link
Contributor

BPO 24285
Nosy @brettcannon, @ronaldoussoren, @ncoghlan, @encukou, @ericsnowcurrently
Superseder
  • bpo-24268: PEP 489 -- Multi-phase extension module initialization
  • Files
  • issue-24285.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-05-25.21:22:20.206>
    created_at = <Date 2015-05-25.12:04:49.785>
    labels = ['type-bug']
    title = 'regression for importing extensions in packages'
    updated_at = <Date 2015-05-26.11:58:35.750>
    user = 'https://github.com/ronaldoussoren'

    bugs.python.org fields:

    activity = <Date 2015-05-26.11:58:35.750>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-05-25.21:22:20.206>
    closer = 'berker.peksag'
    components = []
    creation = <Date 2015-05-25.12:04:49.785>
    creator = 'ronaldoussoren'
    dependencies = []
    files = ['39494']
    hgrepos = []
    issue_num = 24285
    keywords = []
    message_count = 5.0
    messages = ['244030', '244031', '244035', '244098', '244099']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'ronaldoussoren', 'ncoghlan', 'petr.viktorin', 'python-dev', 'eric.snow']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = '24268'
    type = 'behavior'
    url = 'https://bugs.python.org/issue24285'
    versions = ['Python 3.5']

    @ronaldoussoren
    Copy link
    Contributor Author

    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)

    @ronaldoussoren
    Copy link
    Contributor Author

    The attached patch appears to fix the issue. This appears to be an off-by-one error.

    @ronaldoussoren ronaldoussoren added the type-bug An unexpected behavior, bug, or error label May 25, 2015
    @encukou
    Copy link
    Member

    encukou commented May 25, 2015

    bpo-24268 has a patch with a test case.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 26, 2015

    New changeset 55e6f3f94b99 by Nick Coghlan in branch '3.5':
    Issue bpo-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 bpo-24285 from 3.5
    https://hg.python.org/cpython/rev/32ee7b9d58c9

    @ncoghlan
    Copy link
    Contributor

    Since this error was in the beta release, I used this issue reference in the NEWS file, rather than the original implementation issue.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants