From 3fce8abf68f386d18f2fad9f086e0d436af57b3a Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Wed, 16 Apr 2014 21:58:03 +0200 Subject: 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 --- sites/www/changelog.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sites/www/changelog.rst') diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 21ba6e12..67c4f827 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,13 @@ Changelog ========= +* :bug: 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 + Thanks Antoine Brenner * :bug:`-` Added self.args for exception classes. Used for unpickling. Related to (`Fabric #986 `_, `Fabric #714 `_). Thanks to Alex -- cgit v1.2.3 From 5636381591aa26a9f31efab450b6bfdd6659cbb3 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Thu, 24 Apr 2014 09:33:38 -0700 Subject: Reword docs/changelog re #315 --- paramiko/file.py | 19 +++++++++---------- sites/www/changelog.rst | 20 +++++++++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'sites/www/changelog.rst') diff --git a/paramiko/file.py b/paramiko/file.py index 725ca5f6..70243e40 100644 --- a/paramiko/file.py +++ b/paramiko/file.py @@ -124,15 +124,14 @@ class BufferedFile (object): file first). If the ``size`` argument is negative or omitted, read all the remaining data in the file. - `'b' mode flag is ignored (self.FLAG_BINARY in self._flags), because - SSH treats all files as binary, since we have no idea what encoding - the file is in, or even if the file is text data. - + ``'b'`` mode flag is ignored (``self.FLAG_BINARY`` in ``self._flags``), + because SSH treats all files as binary, since we have no idea what + encoding the file is in, or even if the file is text data. :param int size: maximum number of bytes to read :return: - data read from the file (as bytes ), or an empty string - if EOF was encountered immediately + data read from the file (as bytes), or an empty string if EOF was + encountered immediately """ if self._closed: raise IOError('File is closed') @@ -193,10 +192,10 @@ class BufferedFile (object): :return: next line of the file, or an empty string if the end of the file has been reached. - If the file was opened in binary 'b' mode: bytes are returned - Else: the encoding of the file is assumed to be utf-8 (default - encoding used by paramiko.py3compat.u) and character strings - (`str`) are returned + + If the file was opened in binary (``'b'``) mode: bytes are returned + Else: the encoding of the file is assumed to be UTF-8 and character + strings (`str`) are returned """ # it's almost silly how complex this function is. if self._closed: diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 67c4f827..8a4b0f56 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,13 +2,19 @@ Changelog ========= -* :bug: 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 - Thanks Antoine Brenner +* :bug:`-` `paramiko.file.BufferedFile.read` incorrectly returned text strings + after the Python 3 migration, despite bytes being more appropriate for file + contents (which may be binary or of an unknown encoding.) This has been + addressed. + + .. note:: + `paramiko.file.BufferedFile.readline` continues to return strings, not + bytes, as "lines" only make sense for textual data. It assumes UTF-8 by + default. + + This should fix `this issue raised on the Obnam mailing list + `_. Thanks + to Antoine Brenner for the patch. * :bug:`-` Added self.args for exception classes. Used for unpickling. Related to (`Fabric #986 `_, `Fabric #714 `_). Thanks to Alex -- cgit v1.2.3 From c0667e1e6a1dd9b6cf2e47762b51d085417eb7c8 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 7 May 2014 13:39:39 -0700 Subject: Cut 1.11.6 --- paramiko/__init__.py | 2 +- setup.py | 2 +- sites/www/changelog.rst | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sites/www/changelog.rst') diff --git a/paramiko/__init__.py b/paramiko/__init__.py index ce3f0cf9..25ec6679 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 5): __author__ = "Jeff Forcier " -__version__ = "1.11.5" +__version__ = "1.11.6" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 6222a7b0..6cb40de1 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ if sys.platform == 'darwin': setup( name = "paramiko", - version = "1.11.5", + version = "1.11.6", description = "SSH2 protocol library", long_description = longdesc, author = "Jeff Forcier", diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index b84f7758..6ad85927 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,7 @@ Changelog ========= +* :release:`1.11.6 <2014-05-07>` * :bug:`-` Added self.args for exception classes. Used for unpickling. Related to (`Fabric #986 `_, `Fabric #714 `_). Thanks to Alex -- cgit v1.2.3 From 09e9d48db06b7e6eff090dc2cbbb94fef18a1b2c Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 7 May 2014 13:47:09 -0700 Subject: Cut 1.12.4 --- paramiko/__init__.py | 2 +- setup.py | 2 +- sites/www/changelog.rst | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sites/www/changelog.rst') diff --git a/paramiko/__init__.py b/paramiko/__init__.py index 63d52bd3..d6a03898 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 5): __author__ = "Jeff Forcier " -__version__ = "1.12.3" +__version__ = "1.12.4" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 5fd9d044..04286b15 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ if sys.platform == 'darwin': setup( name = "paramiko", - version = "1.12.3", + version = "1.12.4", description = "SSH2 protocol library", long_description = longdesc, author = "Jeff Forcier", diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 3f8fbdc7..524cf0dc 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,7 @@ Changelog ========= +* :release:`1.12.4 <2014-05-07>` * :release:`1.11.6 <2014-05-07>` * :bug:`-` Added self.args for exception classes. Used for unpickling. Related to (`Fabric #986 `_, `Fabric -- cgit v1.2.3 From 7484a221803a3f9aa959d9fd02770ee9c2c90ad5 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 7 May 2014 14:14:05 -0700 Subject: Cut 1.13.1 --- paramiko/__init__.py | 2 +- setup.py | 2 +- sites/www/changelog.rst | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sites/www/changelog.rst') diff --git a/paramiko/__init__.py b/paramiko/__init__.py index b1d9aaa9..22f1bc21 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 6): __author__ = "Jeff Forcier " -__version__ = "1.13.0" +__version__ = "1.13.1" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 4a858326..05dc98d5 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ if sys.platform == 'darwin': setup( name = "paramiko", - version = "1.13.0", + version = "1.13.1", description = "SSH2 protocol library", long_description = longdesc, author = "Jeff Forcier", diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index fbb3270f..a652e565 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,7 @@ Changelog ========= +* :release:`1.13.1 <2014-05-07>` * :release:`1.12.4 <2014-05-07>` * :release:`1.11.6 <2014-05-07>` * :bug:`-` `paramiko.file.BufferedFile.read` incorrectly returned text strings -- cgit v1.2.3 From 951faed80b017e553a27c4cb98f210df44341f8f Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 7 May 2014 16:13:33 -0700 Subject: Cut 1.14 --- paramiko/__init__.py | 2 +- setup.py | 2 +- sites/www/changelog.rst | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sites/www/changelog.rst') diff --git a/paramiko/__init__.py b/paramiko/__init__.py index 22f1bc21..4c62ad4a 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 6): __author__ = "Jeff Forcier " -__version__ = "1.13.1" +__version__ = "1.14.0" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 05dc98d5..c0f1e579 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ if sys.platform == 'darwin': setup( name = "paramiko", - version = "1.13.1", + version = "1.14.0", description = "SSH2 protocol library", long_description = longdesc, author = "Jeff Forcier", diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 52fe4ff3..f8a4d2c1 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,7 @@ Changelog ========= +* :release:`1.14.0 <2014-05-07>` * :release:`1.13.1 <2014-05-07>` * :release:`1.12.4 <2014-05-07>` * :release:`1.11.6 <2014-05-07>` -- cgit v1.2.3