diff options
author | Scott Maxwell <scott@codecobblers.com> | 2013-11-02 14:56:43 -0700 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2013-11-02 14:56:43 -0700 |
commit | 45e65b6e1eb47944a26e4349d41998844c155df5 (patch) | |
tree | 3bc7cb1f1fcfd1d7230f71c9e083c30485f1f951 /paramiko/common.py | |
parent | 7decda3297089b2b2e73bb9cd7e577f9b2cb2789 (diff) | |
download | paramiko-45e65b6e1eb47944a26e4349d41998844c155df5.tar.gz |
Make sftp.open handle binary and text, more type conversion
Diffstat (limited to 'paramiko/common.py')
-rw-r--r-- | paramiko/common.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/paramiko/common.py b/paramiko/common.py index 476ebf52..223aac1a 100644 --- a/paramiko/common.py +++ b/paramiko/common.py @@ -127,12 +127,16 @@ zero_byte = byte_chr(0) one_byte = byte_chr(1) four_byte = byte_chr(4) max_byte = byte_chr(0xff) -newline_byte = byte_chr(10) +cr_byte = byte_chr(13) +linefeed_byte = byte_chr(10) +crlf = cr_byte + linefeed_byte if PY3: - cr_byte = 13 + cr_byte_value = 13 + linefeed_byte_value = 10 else: - cr_byte = '\r' + cr_byte_value = cr_byte + linefeed_byte_value = linefeed_byte def asbytes(s): |