summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Hertz <mvhertz@gmail.com>2024-08-16 14:21:03 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2024-09-08 11:04:42 +0200
commitc88f750108ede64cdd1e4ea143981b9212b13360 (patch)
tree46d836b5440318d32d60310720756a481f4d1d1c
parent[CI] Fix accidental revert of Twisted pin for Windows (diff)
downloaddeluge-c88f750108ede64cdd1e4ea143981b9212b13360.tar.xz
deluge-c88f750108ede64cdd1e4ea143981b9212b13360.zip
[Console] Block interactive-mode on Windows even with windows-curses
Testing with window-curses results in hangs on initial loading with background error: File "C:\Users\Docker\Deluge\.venv\lib\site-packages\twisted\internet\selectreactor.py", line 39, in win32select r, w, e = select.select(r, w, w, timeout) builtins.OSError: [WinError 10038] An operation was attempted on something that is not a socket This is due to passing a Console class to addReader but this fails since select on Windows cannot handle non-socket file object unlike Unix which accepts sockets and file objects. There is likely a further issue where windows-curses has not implemented resizeterm so would need to use resize_term instead. Refs: https://docs.python.org/3/library/select.html#select.select Refs: https://stackoverflow.com/questions/11731175/python-twisted-addreader-works-in-linux-but-not-windows Refs: https://github.com/zephyrproject-rtos/windows-curses/issues/40 Refs: https://docs.python.org/3/library/curses.html#curses.resize_term Closes: https://github.com/deluge-torrent/deluge/pull/457 Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
-rw-r--r--deluge/ui/console/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
index 106169f0e..667b0c924 100644
--- a/deluge/ui/console/main.py
+++ b/deluge/ui/console/main.py
@@ -138,7 +138,7 @@ class ConsoleUI(component.Component, TermResizeHandler):
except ImportError:
wrapper = None
- if deluge.common.windows_check() and not wrapper:
+ if deluge.common.windows_check():
print(
"""\nDeluge-console does not run in interactive mode on Windows. \n
Please use commands from the command line, e.g.:\n
@@ -148,6 +148,7 @@ deluge-console.exe "add --help"
deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
"""
)
+ return
# We don't ever want log output to terminal when running in
# interactive mode, so insert a dummy here