Conversation
| raise OSError(msg, errno.ENOENT) | ||
| p = Popen([cmd_path] + argv[1:]) # noqa: S603 | ||
| # Quoting path in Windows | ||
| cmd_line = f'"{cmd_path}"' + "".join(f' "{arg}"' for arg in argv[1:]) |
There was a problem hiding this comment.
This definitely will not be correct when arg contains quotes. Passing a list to Popen should result in proper quoting. If it doesn't, I think this is a bug in Python itself.
Instead of building quoted strings by hand, we should always use libraries like shlex to make sure it's done correctly or in a platform-independent way (in fact, that is why we pass a list to Popen, so I'm not sure what's going wrong here)
Can you check if Popen(["some path", "with spaces"]) works for you without any Jupyer calls?
There was a problem hiding this comment.
You can also log what [cmd_path] + argv[1:] is, and post a version here to try to see why it could be wrong.
There was a problem hiding this comment.
Yes, sure. I will deep dive and report.
Fixing bug #442, which occur because Windows paths are not quoted properly. If the user path has special chararacters ( parenthesis or spaces), jupyter_core breaks.