Commit Graph

71 Commits

Author SHA1 Message Date
Antoine Brenner 3fce8abf68 BufferedFile.read() now returns byte strings instead of text strings
It is the right thing to do since we have no idea what encoding the file
is in, or even if the file is text data. BufferedFile.readline() is
unchanged and returns text strings assuming the file is utf-8 encoded.
This should fix the following issue:
http://comments.gmane.org/gmane.comp.sysutils.backup.obnam/252

Antoine Brenner

Conflicts:
	sites/www/changelog.rst
2014-04-17 17:52:34 -04:00
Jeff Forcier ba017e9e6c Merge branch '1.12' into 1.13
Conflicts:
	paramiko/sftp_client.py
	sites/www/changelog.rst
	tests/test_sftp.py
2014-04-16 15:24:04 -04:00
Jeff Forcier 6e9abc39cf Fix logging error in sftp_client for filenames containing the character.
Bug reported here:
http://vlists.pepperfish.net/pipermail/obnam-flarn.net/2013-May/000767.html

Antoine Brenner

Backported to 1.11 by @bitprophet

Conflicts:
	paramiko/sftp_client.py
	sites/www/changelog.rst
	tests/test_sftp.py
2014-04-16 15:07:56 -04:00
Scott Maxwell f0017b8330 Fix import * and a bunch of PEP8 formatting 2014-03-07 20:45:26 -08:00
Jeff Forcier b4cd4bea1d Start in on star import eradication 2014-03-07 16:17:19 -08:00
Scott Maxwell aa8ea3c4d4 Add getcwd test 2014-01-16 19:36:04 -08:00
Scott Maxwell 6d75c75e64 Remove byte conversions and unhexlify calls that we only needed for Py2.5 support and use the `b` byte string marker instead 2013-11-19 10:09:08 -08:00
Scott Maxwell 981f768a62 Remove `from __future__ import with_statement` 2013-11-19 09:38:05 -08:00
Scott Maxwell dcc78768bf Remove unnecessary vars for open 2013-11-19 09:38:05 -08:00
Scott Maxwell 2da5f1fb45 Use 'with' for opening most file and SFTPFIle objects 2013-11-19 08:56:53 -08:00
Scott Maxwell 7471515fff Remove eval that was required for Py25 support 2013-11-19 08:07:46 -08:00
Scott Maxwell 25dd096da0 Change all exceptions to modern format (not Py2.5 compatible) 2013-11-19 08:06:35 -08:00
Scott Maxwell 3ce336c88b Change conditional from PY3 to PY2 to be better prepared for a possible Py4. 2013-11-19 07:30:45 -08:00
Scott Maxwell 7444a99993 Fix some deprecation and resource warnings 2013-11-02 20:19:04 -07:00
Scott Maxwell 45e65b6e1e Make sftp.open handle binary and text, more type conversion 2013-11-02 14:56:43 -07:00
Scott Maxwell 9662a7f779 Changes inspired by the nischu7 branch 2013-11-01 09:49:52 -07:00
Scott Maxwell 201a61d66d Have to use u'' format in test_sftp so this test won't run on Py3.2 unless we find a solution 2013-11-01 01:02:50 -07:00
Scott Maxwell fee18142a5 Fixes for Python 2.5 and Python 3.2 support 2013-11-01 00:51:00 -07:00
Scott Maxwell 0677ea76cd Fixes for test_sftp 2013-10-31 17:20:27 -07:00
Scott Maxwell 0b7d0cf0a2 Convert and detect types properly, use helper constants, use StringIO and range 2013-10-30 17:14:52 -07:00
Scott Maxwell 0e4ce3762a Fix message sending
Create constants for byte messages, implement asbytes so many methods can take Message and key objects directly and split get_string into get_text and get_binary. Also, change int handling to use mpint with a flag whenever the int is greater than 32 bits.
2013-10-30 17:09:34 -07:00
Scott Maxwell 644c52266c Use test_path to avoid relative path issues 2013-10-30 16:22:52 -07:00
Scott Maxwell 66cfa97cce Fix imports 2013-10-30 16:19:30 -07:00
Jeff Forcier e25c7c4bdf Merge branch '1.9' into 1.10 2013-09-27 21:29:51 -07:00
Jeff Forcier 83f44878ea Fixed a typo in the license header of most files
Conflicts:
	paramiko/proxy.py
2013-09-27 21:29:18 -07:00
Jason R. Coombs a3fe422198 Adding test capturing desired behavior and demonstrating issue #142. 2013-03-04 08:45:00 -05:00
Jason R. Coombs 3a9119d78a Delint test_sftp (remove unused imports and unused variables, remove excess whitespace, move imports to top, remove semicolon terminator)
--HG--
extra : source : 01df712a396de5fa7e1c0cc265411fdb2bbc5f41
2013-03-04 08:17:22 -05:00
Michael Williamson 08109136b4 Replace useless version check with import from __future__ 2013-01-05 00:15:26 +00:00
Michael Williamson 0b6aebb8a9 Verify Python version >= 2.6 before running context manager test 2013-01-05 00:05:58 +00:00
Michael Williamson 602250fdf9 Turn SFTPFile into a context manager 2013-01-04 23:43:15 +00:00
Robey Pointer f67cea44d0 code style and fix test. 2010-04-13 18:52:29 -07:00
Larry Wright b4ee844a3c added functionality to skip verifying the file, which works around sftp servers that remove the file immediately after it's been closed. 2009-12-18 17:02:55 -06:00
Robey Pointer 931f71e627 bug 411099: chdir() isn't saving the cwd in a normalized way. added test. 2009-10-31 16:06:53 -07:00
Robey Pointer 60c6e94e7d fix my email address to be the current one. 2009-07-19 19:45:02 -07:00
Robey Pointer fbfd8126c8 [project @ robey@lag.net-20080706230815-v2ybqxm237zw0wa0]
add a callback method that can be used to track get/put progress in
SFTPClient. suggested by Phil Schwartz.
2008-07-06 16:08:15 -07:00
Robey Pointer 83b335e10f [project @ robey@lag.net-20070213191706-v8djxd4jiunb3his]
bump copyright year to 2007
2007-02-13 11:17:06 -08:00
Robey Pointer df20443b29 [project @ robey@lag.net-20060901205930-021bcc34e3d5d8c8]
sadly, revert the append optimization -- it breaks for openssh
2006-09-01 13:59:30 -07:00
Robey Pointer 145ceab54c [project @ robey@lag.net-20060823025538-3f8a4d761d7d4118]
when a file is open for append, don't stat to get the file position unless the user asks for it explicitly
2006-08-22 19:55:38 -07:00
Robey Pointer 074dc36e6b [project @ robey@lag.net-20060801182143-088ff687e0945937]
use hexlify in tests
2006-08-01 11:21:43 -07:00
Robey Pointer 0ad8405d15 [project @ robey@lag.net-20060512172544-f1cab2a1959987bf]
fix new cygwin test failures reported by alexander
2006-05-12 10:25:44 -07:00
Robey Pointer aac434e9b0 [project @ robey@lag.net-20060503163531-2297cd257acc51e5]
make a slightly different exception for the expected mode on cygwin (why would they add support for some but not all of the unix mode bits? very odd)
2006-05-03 09:35:31 -07:00
Robey Pointer 9819087210 [project @ robey@lag.net-20060428172401-ad8da020daedd941]
2 more unit test bugs found by alexander (can't change atime on win32)
2006-04-28 10:24:01 -07:00
Robey Pointer abb7f1f1ba [project @ robey@lag.net-20060420072627-958cad5e36cb8ecc]
fix a bug where prefetch() at EOF would throw an exception, and add a unit test
2006-04-20 00:26:27 -07:00
Robey Pointer ccc1046a5c [project @ robey@lag.net-20060406181821-68f9bc13b3580d37]
some fixes for win32: potential fix for lockup during failed tests; don't try chmod/chown or symlinks; fix canonicalize to convert dos-style path separators to '/'; open local files in binary mode; close a file before erasing it
2006-04-06 11:18:21 -07:00
Robey Pointer 89e39a4559 [project @ robey@lag.net-20060309081455-84be2ae54f98e897]
move sftp big-file tests into a separate class and add one that does a prefetch, then seeks in random order
2006-03-09 00:14:55 -08:00
Robey Pointer 4be91d1c4d [project @ robey@lag.net-20060220031741-3227438ff1b03a29]
add SFTPClient.truncate.  add chmod, chown, utime, and truncate to SFTPFile.  and of course tests.
2006-02-19 19:17:41 -08:00
Robey Pointer a6b4875286 [project @ robey@ralph.lag.net-20051203043223-8ee54573dcda1386]
new unit test for doing a bunch of prefetches at once
2005-12-02 20:32:23 -08:00
Robey Pointer ee8a4e4b2b [project @ robey@lag.net-20051202120305-73accda404b89d27]
dumb test to verify utf8 encoding
2005-12-02 04:03:05 -08:00
Robey Pointer 6de6dc72c6 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-80]
add 'x' flag to open to allow O_EXCL behavior
2005-11-12 01:10:41 +00:00
Robey Pointer 66919286b6 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-72]
don't attempt to start a rekey negotiation from within send_message -- always do it from the feeder thread.  this prevents a situation where more than one thread may decide spontaneously to rekey, sending multiple kexinit messages, which confuses the hell out of the remote host :)  also, do some locking around the clear-to-send event, to avoid a race when we first go into rekeying.  add some tests for these things too
2005-10-29 20:47:04 +00:00