This routine is already a hack, I think only necessary because of remaining issues with backslash handling in Windows, but while it's here, is there any reason not to simply escape any double quotes in the filename (for non-Windows platforms) and wrap the whole thing in double quotes (for all platforms)?
BUG: Improve hack. Issue #755. execute_file fails if filename has spaces
On master, this works for me in both the terminal and the qt console:
In : d a\ b
-rwxr-xr-x 1 fperez 187 2011-12-06 03:03 argv.py*
In : run a\ b/argv.py
argv: ['a b/argv.py']
My PID is: 5547
my name is: __main__
are you still seeing the problem? If so, on which platforms?
BUG: Issue #755 qt IPythonWidget.execute_file fails if filename conta…
…ins single and double quotes
Sorry, should have updated this issue after commits.
AFAICT, qtconsole's IPythonWidget.execute_file is not used anywhere in the IPython-qtconsole application. It is available for use in applications which incorporate a qtconsole.
Commits 3ccb8ee and 03159d0 resolved all but an extreme edge case (a filename containing both single and double quotes).
PR #1122 should resolve that final case. Not sure why I was hesitant to make this change originally.
Making this last fix did reveal what appears to be a very minor bug in %run: issue #1123
Merge PR #1122 (IPythonWidget.execute_file)
Fixes escaped filename in IPythonWidget.execute_file, when it contains
spaces and/or quotes.