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

Yet another disgusting hack for python 3.11.2 bug #236

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions qubesadmin/backup/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import tempfile
import termios
import time
import threading
# only for a python bug workaround
import concurrent.futures.thread

Expand Down Expand Up @@ -309,9 +310,18 @@ def _fix_threading_after_fork():
otherwise atexit callback will crash.

https://github.com/python/cpython/issues/88110

And initialize DummyThread locks:
https://github.com/python/cpython/issues/102512
"""
# pylint: disable=protected-access
concurrent.futures.thread._threads_queues.clear()
thread = threading.current_thread()
if isinstance(thread, threading._DummyThread) and \
getattr(thread, '_tstate_lock', "missing") is None:
# mimic threading._after_fork()
thread._set_tstate_lock()



class ExtractWorker3(Process):
Expand Down