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

os.listdir inconsistenly releases the GIL on win32 #51164

Closed
rfk mannequin opened this issue Sep 15, 2009 · 2 comments
Closed

os.listdir inconsistenly releases the GIL on win32 #51164

rfk mannequin opened this issue Sep 15, 2009 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@rfk
Copy link
Mannequin

rfk mannequin commented Sep 15, 2009

BPO 6915
Nosy @loewis, @pitrou
Files
  • listdir_gil.patch
  • 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/pitrou'
    closed_at = <Date 2010-08-10.00:04:32.716>
    created_at = <Date 2009-09-15.04:43:13.840>
    labels = ['type-bug', 'library']
    title = 'os.listdir inconsistenly releases the GIL on win32'
    updated_at = <Date 2010-08-10.00:04:32.714>
    user = 'https://bugs.python.org/rfk'

    bugs.python.org fields:

    activity = <Date 2010-08-10.00:04:32.714>
    actor = 'pitrou'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2010-08-10.00:04:32.716>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2009-09-15.04:43:13.840>
    creator = 'rfk'
    dependencies = []
    files = ['14892']
    hgrepos = []
    issue_num = 6915
    keywords = ['patch']
    message_count = 2.0
    messages = ['92643', '113500']
    nosy_count = 3.0
    nosy_names = ['loewis', 'pitrou', 'rfk']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6915'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @rfk
    Copy link
    Mannequin Author

    rfk mannequin commented Sep 15, 2009

    The win32 implementation of os.listdir() releases the GIL around calls
    to FindNextFile, but not around calls to FindFirstFile. Attached is a
    simple patch to consistently release the GIL around any such calls.

    @rfk rfk mannequin added the type-bug An unexpected behavior, bug, or error label Sep 15, 2009
    @BreamoreBoy BreamoreBoy mannequin added the stdlib Python modules in the Lib dir label Jul 11, 2010
    @birkenfeld birkenfeld assigned pitrou and unassigned loewis Aug 2, 2010
    @pitrou
    Copy link
    Member

    pitrou commented Aug 10, 2010

    The original patch also modifies attributes_from_dir() and attributes_from_dir_w(), but these are called with the GIL released.
    Modified patch committed in r83921 (py3k), r83922 (3.1) and r83923 (2.7). Thank you!

    @pitrou pitrou closed this as completed Aug 10, 2010
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant