Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape with double quotes instead of single quotes #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

remram44
Copy link
Collaborator

Fix maybe #138?

This takes us away from the standard shlex implementation. It is still not what you want on Windows (backslashes will not be understood), however it should do what you want in more situations (for example it supports spaces).

@remram44 remram44 added the bug label Feb 28, 2020
@remram44 remram44 force-pushed the escape-with-double-quotes branch 2 times, most recently from 67c5cab to aff0c88 Compare February 28, 2020 03:48
This takes us away from the standard shlex implementation. It is still
not what you want on Windows (backslashes will not be understood),
however it should do what you want in more situations (for example it
supports spaces).
@remram44 remram44 force-pushed the escape-with-double-quotes branch from 8860870 to 21e8fed Compare February 28, 2020 03:55
@remram44
Copy link
Collaborator Author

@vtyw if you could please test this version against your Windows server, I'd appreciate it :)

@vtyw
Copy link

vtyw commented Mar 1, 2020

I can confirm that it works with spaces e.g., scp.get('V:/sample 1.txt'). Are there any other characters you'd like me to test?

@remram44
Copy link
Collaborator Author

remram44 commented Mar 1, 2020

Thank you so much!

I think quotes are outright forbidden in Windows paths. Maybe $ % ^ ?

@vtyw
Copy link

vtyw commented Mar 1, 2020

There is an inconsistency in the naming of the file if you don't specify local_path:

  • scp.get('V:/sample 1.txt') => 'sample 1.txt' (single quotes in the filename)
  • scp.get("V:/s$.txt") => scp.SCPException: scp: V:/s/$.txt: No such file or directory
  • scp.get("V:/s^.txt") => 's^.txt' (single quotes in filename)
  • scp.get("V:/s%.txt") => s%.txt(no quotes in filename)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants