Skip to content

Remote path containing backslash not matched on Windows server when using scp.SCPClient.get from Linux client #138

@vtyw

Description

@vtyw

When trying to get a file such as V:\test.txt from a Windows host, this exception occurs:

Traceback (most recent call last):
  ...
    scp.get("V:\\test.txt")
  File "/home/user/.virtualenvs/opencv-4.2.0/lib/python3.6/site-packages/scp.py", line 238, in get
    self._recv_all()
  File "/home/user/.virtualenvs/opencv-4.2.0/lib/python3.6/site-packages/scp.py", line 388, in _recv_all
    raise SCPException(asunicode(msg[1:]))
scp.SCPException: scp: 'V:/test.txt': No such file or directory

It looks like backslashes get converted to forward slashes which would make it impossible to copy anything from a Windows server to a Linux client. I also note that spaces in filenames passed to scp.SCPClient.get are treated as if scp is requesting multiple separate files, so it seems like there is both shell interpretation going on AND some unwarranted Linux-style translation of the path happening on a Linux client.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions