So I'm writing my own launcher for youtube-dl just for my own personal use, and to familiarize myself with Python a little bit more. When I run it in Linux, it works normally, and if I cancel a download with CTRL+C, the "Interrupted by User" error message appears. If I run it in Windows, it works normally, except the "Interrupted by User" error message does not appear when I cancel a download with CTRL+C. The other error messages such as the "Invalid URL" one works, so I know it's making down into the "elif download is not 0:" portion, but that one error message doesn't appear.
It's not the end of the world, and I'm suspecting this has something to do with the way Windows, or the Windows version of youtube-dl, handles the CTRL+C keyboard interrupt. Here's the block of code that launches the download and then displays messages according to the outcome.
If you have issues opening the link let me know and I'll re-do it, but Neowin's code bracket didn't recognize any of the indentions, and it looked a bit confusing, so I thought this would be easier to read.
Question
Gerowen
So I'm writing my own launcher for youtube-dl just for my own personal use, and to familiarize myself with Python a little bit more. When I run it in Linux, it works normally, and if I cancel a download with CTRL+C, the "Interrupted by User" error message appears. If I run it in Windows, it works normally, except the "Interrupted by User" error message does not appear when I cancel a download with CTRL+C. The other error messages such as the "Invalid URL" one works, so I know it's making down into the "elif download is not 0:" portion, but that one error message doesn't appear.
It's not the end of the world, and I'm suspecting this has something to do with the way Windows, or the Windows version of youtube-dl, handles the CTRL+C keyboard interrupt. Here's the block of code that launches the download and then displays messages according to the outcome.
Code Snippet
If you have issues opening the link let me know and I'll re-do it, but Neowin's code bracket didn't recognize any of the indentions, and it looked a bit confusing, so I thought this would be easier to read.
Link to comment
https://www.neowin.net/forum/topic/1194733-python-keyboard-interrupt-and-windows/Share on other sites
3 answers to this question
Recommended Posts