Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gzip_ng_threaded prevents programs from crashing if a file is open #53

Copy link
Copy link
Closed
@D-VR

Description

@D-VR
Issue body actions

If you use gzip_ng_threaded and open a file with multiple threads, any Exceptions thrown will cause Python to hang indefinitely.

This seems to be because the thread lock is never released.

Code to trigger the bug:

from zlib_ng import gzip_ng_threaded as gzip

file_ = gzip.open("Throwaway", "wb", threads=2)

raise Exception("weird")

example output (KeyboardInterrupt was used to quit the program):

~/venv/bin/python ~/testing.py 
Traceback (most recent call last):
  File "~/testing.py", line 5, in <module>
    raise Exception("weird")
Exception: weird

Exception ignored in: <module 'threading' from '/usr/lib/python3.12/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1622, in _shutdown
    lock.acquire()
KeyboardInterrupt: 

Process finished with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.