Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow %magic argument filenames with spaces to be specified with quotes under win32 #734

Merged
merged 2 commits into from Aug 29, 2011

Conversation

Projects
None yet
3 participants
Contributor

rkern commented Aug 26, 2011

This just modifies get_py_filename() to apply Windows semantics to the filename when quoted. This should fix the majority of %magic commands that take file names. There are probably some others that do not use get_py_filename().

This does not fix completion yet.

Fixes #773, I think. I haven't spun up a Windows VM to test it there on a full system, but the unit tests have been written to test the functionality on all platforms.

Contributor

epatters commented Aug 26, 2011

If this is merged, then we can also get rid of this old hack in IPythonWidget:

https://github.com/ipython/ipython/blob/master/IPython/frontend/qt/console/ipython_widget.py#L252

Contributor

jdmarch commented Aug 28, 2011

Works as desired in Windows XP for %run and %cd
(also still works correctly in OSX and Ubuntu)

Unsurprisingly, in Windows:
%save is still broken (not high priority IMO)
Tab completion is still broken for space-containing paths.

@rkern rkern BUG: break out the filename-unquoting from get_py_filename to be used…
… in other contexts. Fix %save, in this respect.
e3bec84
Contributor

rkern commented Aug 29, 2011

That should have fixed %save.

Contributor

jdmarch commented Aug 29, 2011

Yes, %save now works in Windows XP.

Contributor

jdmarch commented Aug 29, 2011

Also works on Windows 7.
All relevant (previously passing) tests pass in Windows.

@jdmarch jdmarch added a commit that referenced this pull request Aug 29, 2011

@jdmarch jdmarch Merge pull request #734 from rkern/fix-windows-quotes
Allow %magic argument filenames with spaces to be specified with quotes under win32
6ecc466

@jdmarch jdmarch merged commit 6ecc466 into ipython:master Aug 29, 2011

Contributor

jdmarch commented Aug 29, 2011

@epatters - I don't think the hack in IPythonWidget can be removed until problems of handling backslashes in Windows filenames is better resolved.

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

@jdmarch jdmarch Merge pull request #734 from rkern/fix-windows-quotes
Allow %magic argument filenames with spaces to be specified with quotes under win32
f31b96e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment