diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2009-11-27 16:20:13 -0500 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2009-11-27 16:20:13 -0500 |
commit | d04355ae59eba8a96d4341ec3db9d81470344703 (patch) | |
tree | eba8c41ff15e11805b51fe959cd0906c86bb0ede /paramiko/sftp_si.py | |
parent | b30290e934385616ea48a55ecae5912f651b0bf7 (diff) | |
parent | ed280d5ac360e2af796e9bd973d7b4df89f0c449 (diff) | |
download | python-paramiko-d04355ae59eba8a96d4341ec3db9d81470344703.tar python-paramiko-d04355ae59eba8a96d4341ec3db9d81470344703.tar.gz |
Merge branch 'upstream'
Diffstat (limited to 'paramiko/sftp_si.py')
-rw-r--r-- | paramiko/sftp_si.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/paramiko/sftp_si.py b/paramiko/sftp_si.py index 16005d4..47dd25d 100644 --- a/paramiko/sftp_si.py +++ b/paramiko/sftp_si.py @@ -1,4 +1,4 @@ -# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net> +# Copyright (C) 2003-2007 Robey Pointer <robey@lag.net> # # This file is part of paramiko. # @@ -36,6 +36,9 @@ class SFTPServerInterface (object): SFTP sessions). However, raising an exception will usually cause the SFTP session to abruptly end, so you will usually want to catch exceptions and return an appropriate error code. + + All paths are in string form instead of unicode because not all SFTP + clients & servers obey the requirement that paths be encoded in UTF-8. """ def __init__ (self, server, *largs, **kwargs): @@ -268,9 +271,13 @@ class SFTPServerInterface (object): The default implementation returns C{os.path.normpath('/' + path)}. """ if os.path.isabs(path): - return os.path.normpath(path) + out = os.path.normpath(path) else: - return os.path.normpath('/' + path) + out = os.path.normpath('/' + path) + if sys.platform == 'win32': + # on windows, normalize backslashes to sftp/posix format + out = out.replace('\\', '/') + return out def readlink(self, path): """ |