`--ah-cli` crashes when i try to exit it
- Lingua principale
- Python
- Stelle
- 46.6k
- Fork
- 1.9k
- Merge medio
- 10g 16h
- PR unite (30g)
- 5
Descrizione
### Describe the bug
When trying to exit the subshell from `copyparty --ah-cli`, the script crashes.
### To Reproduce
1. run `copyparty --ah-cli --ah-alg argon2`
2. press `^D` to close the stdin stream
3. observe that it crashes
### Expected behavior
I expected the CLI to exit gracefully.
### Additional context
The script handles signals just fine: pressing `^C` to send `SIGINT` *does* exit gracefully.
Normally, in these kinds of subshell-like applications, `^C` ("interrupt signal") interrupts the current operation and gives me a fresh prompt, while `^D` ("end of transmission") exits the application and takes me to the previous prompt (e.g. bash).
Crashing *does* take me to the previous prompt; i'll give it that. But it's annoying that it also shows me a traceback.
### Traceback
```
[SFX] retcode Traceback (most recent call last):
File "/nix/store/bcgs84rq4p65nbzy2z6rxiwklhmblvid-copyparty-1.18.6/share/copyparty-sfx.py", line 277, in main
run(tmp, j2, ftp)
~~~^^^^^^^^^^^^^^
File "/nix/store/bcgs84rq4p65nbzy2z6rxiwklhmblvid-copyparty-1.18.6/share/copyparty-sfx.py", line 217, in run
run_i(ld)
~~~~~^^^^
File "/nix/store/bcgs84rq4p65nbzy2z6rxiwklhmblvid-copyparty-1.18.6/share/copyparty-sfx.py", line 229, in run_i
p()
~^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/__main__.py", line 1882, in main
SvcHub(al, dal, argv, "".join(printed)).run()
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/svchub.py", line 276, in __init__
self.asrv = AuthSrv(self.args, self.log, dargs=self.dargs)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/authsrv.py", line 939, in __init__
self.reload()
~~~~~~~~~~~^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/authsrv.py", line 1536, in reload
self._reload(verbosity)
~~~~~~~~~~~~^^^^^^^^^^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/authsrv.py", line 1616, in _reload
self.setup_pwhash(acct)
~~~~~~~~~~~~~~~~~^^^^^^
File "/tmp/pe-copyparty.1000.287675.0/copyparty/authsrv.py", line 2922, in setup_pwhash
sys.exit()
~~~~~~~~^^
SystemExit
```
### Server details (if you're NOT using docker/podman)
* **server OS / version:** NixOS 25.11 Xantusia
* **what copyparty did you grab:** nix package from this repo
* run copyparty with `--version` and grab the last 3 lines (they start with `copyparty`, `CPython`, `sqlite`) and paste them below this line:
```
copyparty v1.18.6 "logtail" (2025-07-28)
CPython v3.13.5 on Linux64 [GCC 14.3.0]
sqlite 3.50.1*1 | jinja 3.1.6 | pyftpd 1.5.10 | tftp 0.4.0
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.