Skip to content

Commit cc913d4

Browse files
committed
Initialize asyncio event loop before using it
Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not initialized before using it. Resolves: QubesOS/qubes-issues#10188
1 parent f6ba2f4 commit cc913d4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

qubespdfconverter/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ def main(**params):
677677
logging.basicConfig(format="error: %(message)s")
678678

679679
if params["files"]:
680-
loop = asyncio.get_event_loop()
680+
loop = asyncio.new_event_loop()
681+
asyncio.set_event_loop(loop)
681682
sys.exit(loop.run_until_complete(run(params)))
682683
else:
683684
print("No files to sanitize.")

qubespdfconverter/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ def main():
297297
pdf_path.write_bytes(data)
298298
base = BaseFile(pdf_path)
299299

300-
loop = asyncio.get_event_loop()
300+
loop = asyncio.new_event_loop()
301+
asyncio.set_event_loop(loop)
301302
try:
302303
loop.run_until_complete(base.sanitize())
303304
except subprocess.CalledProcessError:

0 commit comments

Comments
 (0)