devine icon indicating copy to clipboard operation
devine copied to clipboard

Cancelling broken with requests downloader

Open k-santa opened this issue 2 years ago • 1 comments

Describe the bug When using the requests downloader you can't cancel a download using Ctrl+C, the full download and decryption happens and then the cancel kicks in before multiplexing

To Reproduce Set downloads: requests Begin download and try and cancel

Expected behavior We should see the STOPPING on the download process and a near immediate termination

k-santa avatar May 31 '23 08:05 k-santa

This is an issue more or less with the Python stdlib as explained in: https://github.com/psf/requests/issues/5822

Therefore, there isn't realistically much that I can do about this unless I abstract the code to be run as it's own process (which will slow things down). This is because if I run it as a process via subprocess (i.e., subprocess.check_call(["python", "requests_downloader.py", "...args"])) then I can have CTRL+C fire as subprocess would take over there.

I will work on this soon and see if it's a truly viable option.

rlaphoenix avatar Jan 16 '24 14:01 rlaphoenix