From bd7b384e8f25674755c8235158117fd43a30e60f Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Mon, 27 Oct 2025 12:43:51 +0100 Subject: [PATCH] Manually set event loop on windows The behaviour of get_event_loop changed in 3.14 and no longer creates one. Instead, it will crash. --- CHANGELOG.md | 3 +++ PFERD/__main__.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da225b..4fef0e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ ambiguous situations. ## Added - Store the description when using the `internet-shortcut` link format +## Fixed +- Event loop errors on Windows with Python 3.14 + ## 3.8.3 - 2025-07-01 ## Added diff --git a/PFERD/__main__.py b/PFERD/__main__.py index cb8c67c..2de9dbc 100644 --- a/PFERD/__main__.py +++ b/PFERD/__main__.py @@ -133,7 +133,8 @@ def main() -> None: # https://bugs.python.org/issue39232 # https://github.com/encode/httpx/issues/914#issuecomment-780023632 # TODO Fix this properly - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) loop.run_until_complete(pferd.run(args.debug_transforms)) loop.run_until_complete(asyncio.sleep(1)) loop.close()