Terminal broken with python3.12 running sshuttle

I recetly upgraded from Fedora 38 to Fedora 39 which bumps the python version from 3.11.6 to 3.12.

This change has the terminal output of running sshuttle hanging, i.e. CTRL+C not working, pasting not working. I discovered this on my upgraded system, and to rule out any local configuration issues, I booted up a liveiso with fedora 39 workstation, and the issue persisted there:

Then I tinkered with python 3.11, but getting this error running sshuttle as a non-root user (I don’t know how to actually fix this in python 3.11):

Starting sshuttle proxy.
Traceback (most recent call last):
File "/home/user/.local/lib/python3.11/site-packages/sshuttle/__main__.py", line 4, in <module>
   File "/home/user/.local/lib/python3.11/site-packages/sshuttle/cmdline.py", line 26, in main
     return firewall.main(opt.method, opt.syslog)
   File "/home/user/.local/lib/python3.11/site-packages/sshuttle/firewall.py", line 97, in main
     stdin, stdout = setup_daemon()
   File "/home/user/.local/lib/python3.11/site-packages/sshuttle/firewall.py", line 68, in setup_daemon
 PermissionError: [Errno 1] Operation not permitted
 fatal: ['sudo', '-p', '[local sudo] Password: ', '/usr/bin/env', 'PYTHONPATH=/home/user/.local/lib/python3.11/site-packages', '/usr/bin/python3.11', '/home/user/.local/lib/python3.11/site-packages/sshuttle/__main__.py', '-v', '--method', 'auto', '--firewall', '--syslog'] returned 1

Then I got root working with pip and python 3.11 and my script wrapping sshuttle is now working as expected (I also tried this on the liveISO with 3 reboots trying sshuttle 0.78, sshuttle version 1.1.1 from pip and sshuttle version 1.1.1 from dnf):

My question is therefore, how can we get a working sshuttle on python 3.12? Any temporary fix available or a permanent fix for python 3.12? I can technically get this to work as is on version 3.12, but I need to paste stuff into the terminal (as I was able to do before, and in the last example as root) and it’s an unwanted behavior.

Would sshuttle from the Fedora repository work for you?

Available Packages
Name         : sshuttle
Version      : 1.1.1
Release      : 4.fc39
Architecture : noarch
Size         : 192 k
Source       : sshuttle-1.1.1-4.fc39.src.rpm
Repository   : fedora
Summary      : Transparent Proxy VPN
URL          : https://github.com/sshuttle/sshuttle
License      : LGPLv2+
Description  : Transparent proxy server that works as a poor man's VPN. Forwards over ssh.
             : Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.

It would certainly be good to file a bug against sshuttle, so the maintainers are aware and can build a new sshuttle once it supports python 3.12.

for reference, the upstream issue you filed: Terminal broken with python3.12 · Issue #909 · sshuttle/sshuttle · GitHub

Just tried it out, same issue as before, both on workstation and on liveISO

Yes, I have filed an issue with sshuttle, but I’m not sure if this pertains only to fedora’s python installation. Should probably get around to trying it on different distros, but for now the problem definitely persists on fedora 39 with python 3.12.

I have filed a bug in bugzilla so that the maintainers should be aware at least.

1 Like

I also tried this in an arch VM, getting the same results as above.

Some TTY-variables seems to change, maybe related?

❯ stty
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8

After sshuttle-run:
❯ stty
speed 38400 baud; line = 0;
-brkint -icrnl -imaxbel iutf8
-isig -iexten