Changelog + docs re #127

This commit is contained in:
Jeff Forcier 2013-02-27 15:56:09 -08:00
parent a69abd4606
commit 8e697988af
3 changed files with 6 additions and 1 deletions

2
NEWS
View File

@ -15,6 +15,8 @@ Releases
v1.10.0 (DD MM YYYY) v1.10.0 (DD MM YYYY)
-------------------- --------------------
* #127: Turn `SFTPFile` into a context manager. Thanks to Michael Williamson
* for the patch.
* #116: Limit `Message.get_bytes` to an upper bound of 1MB to protect against * #116: Limit `Message.get_bytes` to an upper bound of 1MB to protect against
potential DoS vectors. Thanks to `@mvschaik` for catch & patch. potential DoS vectors. Thanks to `@mvschaik` for catch & patch.
* #115: Add convenience `get_pty` kwarg to `Client.exec_command` so users not * #115: Add convenience `get_pty` kwarg to `Client.exec_command` so users not

View File

@ -198,7 +198,7 @@ class SFTPClient (BaseSFTP):
Open a file on the remote server. The arguments are the same as for Open a file on the remote server. The arguments are the same as for
python's built-in C{file} (aka C{open}). A file-like object is python's built-in C{file} (aka C{open}). A file-like object is
returned, which closely mimics the behavior of a normal python file returned, which closely mimics the behavior of a normal python file
object. object, including the ability to be used as a context manager.
The mode indicates how the file is to be opened: C{'r'} for reading, The mode indicates how the file is to be opened: C{'r'} for reading,
C{'w'} for writing (truncating an existing file), C{'a'} for appending, C{'w'} for writing (truncating an existing file), C{'a'} for appending,

View File

@ -34,6 +34,9 @@ from paramiko.sftp_attr import SFTPAttributes
class SFTPFile (BufferedFile): class SFTPFile (BufferedFile):
""" """
Proxy object for a file on the remote server, in client mode SFTP. Proxy object for a file on the remote server, in client mode SFTP.
Instances of this class may be used as context managers in the same way
that built-in Python file objects are.
""" """
# Some sftp servers will choke if you send read/write requests larger than # Some sftp servers will choke if you send read/write requests larger than