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

Patch for bug 580952: import lock should be exposed #37943

Closed
jdhildeb mannequin opened this issue Feb 9, 2003 · 4 comments
Closed

Patch for bug 580952: import lock should be exposed #37943

jdhildeb mannequin opened this issue Feb 9, 2003 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@jdhildeb
Copy link
Mannequin

jdhildeb mannequin commented Feb 9, 2003

BPO 683257
Nosy @gvanrossum
Files
  • python2.2.2-import.patch: patch against 2.2.2
  • python2.3-2.2.99-import.patch: patch against 2.3-2.2.99
  • 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 = 'https://github.com/gvanrossum'
    closed_at = <Date 2003-02-13.17:11:47.000>
    created_at = <Date 2003-02-09.04:22:26.000>
    labels = ['interpreter-core']
    title = 'Patch for bug 580952: import lock should be exposed'
    updated_at = <Date 2003-02-13.17:11:47.000>
    user = 'https://bugs.python.org/jdhildeb'

    bugs.python.org fields:

    activity = <Date 2003-02-13.17:11:47.000>
    actor = 'gvanrossum'
    assignee = 'gvanrossum'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2003-02-09.04:22:26.000>
    creator = 'jdhildeb'
    dependencies = []
    files = ['5009', '5010']
    hgrepos = []
    issue_num = 683257
    keywords = ['patch']
    message_count = 4.0
    messages = ['42734', '42735', '42736', '42737']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'jdhildeb']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue683257'
    versions = ['Python 2.3']

    @jdhildeb
    Copy link
    Mannequin Author

    jdhildeb mannequin commented Feb 9, 2003

    See bug 580952 for all the details.

    I've attached patches against Python 2.3-2.2.99 (it
    would be great to have this in for 2.3 final), and also
    against Python 2.2.2 (for the next 2.2.x maintenance
    release).

    @jdhildeb jdhildeb mannequin closed this as completed Feb 9, 2003
    @jdhildeb jdhildeb mannequin assigned gvanrossum Feb 9, 2003
    @jdhildeb jdhildeb mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Feb 9, 2003
    @jdhildeb jdhildeb mannequin closed this as completed Feb 9, 2003
    @jdhildeb jdhildeb mannequin assigned gvanrossum Feb 9, 2003
    @jdhildeb jdhildeb mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Feb 9, 2003
    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    I've applied the 2.3 patch, with some changes to avoid the
    fatal error in unlock_import().

    Open issues:

    • This needs docs. Jason, can you provide a doc patch?

    • Why do you want this backported to 2.2? It's a new feature
      after all. Jason, can you comment on that?

    @jdhildeb
    Copy link
    Mannequin Author

    jdhildeb mannequin commented Feb 13, 2003

    Logged In: YES
    user_id=173690

    Yes, I can provide a doc patch. Is there anything that
    needs to be updated other than Doc/lib/libimp.tex? (I'm new
    to the python source tree)

    Re: backporting: Here's my reasoning:

    For a multithreaded Python app which needs to use an import
    hook, there is no way to do this reliably without access to
    the internal import lock. If the app uses a separate lock
    it is possible for a deadlock to happen (see bug 580952 for
    explanation), yet if no locking is done the runtime
    environment can get really screwed up (I've seen it happen).

    So from the perspective of such an app, the Python import
    API is buggy/incomplete because it provides no safe way to
    use an import hook. Therefore I view this patch more as a
    fix than a new feature.

    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Neal Norwitz already add the docs and a test. :-)

    Some belated feedback on your patch: when returning Py_None,
    you must Py_INCREF(Py_None)! Also, please use trailing \ in
    multi-line string literals; the C std requires this even
    though GCC doesn't. :-) (Thanks Neal!)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant