Closed fanmingyu212 closed 2 years ago
Ha, okay. I thought space is also not allowed for folders as it is not for file names.
Just a note: if the tray launcher crashes, it won't terminate scripts that are currently running. So you might need to terminate them manually unfortunately. I haven't found a good way to do clean-up upon abnormal exit. Any ideas?
I think spaces are allowed for both folders and filenames. A good practice may be avoiding using spaces, but that is not always done (e.g. "C:\Program Files" have a space in it.
I see... What you suggested should work. Thanks.
@fanmingyu212 Hey Mingyu, sorry it takes me so long to get back to this!
Do you remember what command did you run that crushed the launcher? I tried to load/run a script from a folder whose name contains a space, and I was getting error messages saying that the path is invalid (I suspect that this is due to argparse
module uses whitespace as a delimiter, so the path got truncated into two elements in the argument list) - the launcher didn't crash.
Running such a script from GUI hasn't shown any problems, so this issue seems to be only related to CLI.
I will be resolving hopefully all the comments tonight.
I think the problem I had was that the user folder path contains a space. That means the tray launcher path in the user folder also contains a space. It crashed when I tried to run a script using the GUI (not related to the CLI at all).
I see.. Thanks for the info. This is very screwed up.
No worry. I think it is just missing quotes in the POpen
command that runs the script. I implemented that fix locally (see the first comment I have above). If you want, I can create a PR for it.
Ah, that’s what you meant! Got it.
Yes a PR will be very helpful. Thank you!
If the user folder path has a space in it, it cannot run scripts and crashes when the user tries to run a script. One solution may be add
"
before and after thescript_path_str
in the constructor ofChildScript
.