Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bug in argument parsing for %run #592
Excerpt from discussion on ipython-dev:
This problem is with master 9e2a3f4, calling %run with parameters that have quotation marks keep the marks in sys.argv.
This is unique to Windows, somehow.
As far as I can tell it is due to shlex that is called from arg_split. When on posix shlex is called with posix=True which removes the quotation marks, but on windows we get posix=False which keeps them. If we call shlex with posix=True on windows we get messed up handling of \ in paths since posix means \ is used for escaping.
Perhaps one solution could be to strip " from elements returned by arg_split when they are present in both ends, any other ideas?
It is really annoying to not be able to use " from run, unfortunately there are often spaces in windows paths.
I do not remember when, but a simple fix for this has gone in already. However quoting only works on the first argument to %run and not for arbitrary arguments.
Running a script that prints argv: