qtconsole ipython widget's execute_file fails if filename contains spaces or quotes #755

Closed
jdmarch opened this Issue Sep 2, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@jdmarch
Contributor

jdmarch commented Sep 2, 2011

(All platforms)

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)?

jdmarch pushed a commit to jdmarch/ipython that referenced this issue Sep 5, 2011

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Dec 6, 2011

Member

On master, this works for me in both the terminal and the qt console:

In [10]: d a\ b
total 4
-rwxr-xr-x 1 fperez 187 2011-12-06 03:03 argv.py*

In [11]: 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?

Member

fperez commented Dec 6, 2011

On master, this works for me in both the terminal and the qt console:

In [10]: d a\ b
total 4
-rwxr-xr-x 1 fperez 187 2011-12-06 03:03 argv.py*

In [11]: 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?

jdmarch added a commit to jdmarch/ipython that referenced this issue Dec 8, 2011

@jdmarch

This comment has been minimized.

Show comment
Hide comment
@jdmarch

jdmarch Dec 8, 2011

Contributor

Sorry, should have updated this issue after commits.

  1. 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.
  2. Commits 3ccb8ee and 03159d0 resolved all but an extreme edge case (a filename containing both single and double quotes).
  3. PR #1122 should resolve that final case. Not sure why I was hesitant to make this change originally.
Contributor

jdmarch commented Dec 8, 2011

Sorry, should have updated this issue after commits.

  1. 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.
  2. Commits 3ccb8ee and 03159d0 resolved all but an extreme edge case (a filename containing both single and double quotes).
  3. PR #1122 should resolve that final case. Not sure why I was hesitant to make this change originally.
@jdmarch

This comment has been minimized.

Show comment
Hide comment
@jdmarch

jdmarch Dec 8, 2011

Contributor

Making this last fix did reveal what appears to be a very minor bug in %run: issue #1123

Contributor

jdmarch commented Dec 8, 2011

Making this last fix did reveal what appears to be a very minor bug in %run: issue #1123

jdmarch added a commit that referenced this issue Dec 12, 2011

@minrk minrk closed this in b24c9d2 Dec 12, 2011

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

Merge PR #1122 (IPythonWidget.execute_file)
Fixes escaped filename in IPythonWidget.execute_file, when it contains
spaces and/or quotes.

closes #755
closes #1122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment