summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorJeremy T. Bouse <jbouse@debian.org>2014-08-28 22:19:48 -0700
committerJeremy T. Bouse <jbouse@debian.org>2014-08-28 22:19:48 -0700
commite93504a2d0a549833b9fa4f4046dfe2396467de9 (patch)
treeb572d0be7fdb636a203fbecb65b02e50ff386e60 /debian/patches
parent4b554501acddcf70d62817e5b8092305a6cd1b34 (diff)
downloadpython-paramiko-e93504a2d0a549833b9fa4f4046dfe2396467de9.tar
python-paramiko-e93504a2d0a549833b9fa4f4046dfe2396467de9.tar.gz
Include upstream GitHub Pull Request #352 to fix RC bug
Bring existing pull request by Jelmer Vernooij <jelmer> that has been submitted upstream but has not been accepted yet in order to work around the critical error. Will remove this patch when either upstream accepts or provides a better fix. Thanks: Jelmer Vernooij <jelmer> Closes: #750517, #755910
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-Upstream-GitHub-Pull-Request-352-to-fix-buffer-objec.patch62
-rw-r--r--debian/patches/series1
2 files changed, 63 insertions, 0 deletions
diff --git a/debian/patches/0001-Upstream-GitHub-Pull-Request-352-to-fix-buffer-objec.patch b/debian/patches/0001-Upstream-GitHub-Pull-Request-352-to-fix-buffer-objec.patch
new file mode 100644
index 0000000..123f7c9
--- /dev/null
+++ b/debian/patches/0001-Upstream-GitHub-Pull-Request-352-to-fix-buffer-objec.patch
@@ -0,0 +1,62 @@
+From: "Jeremy T. Bouse" <Jeremy.Bouse@coxinc.com>
+Date: Sun, 24 Aug 2014 20:47:42 -0400
+Subject: Upstream GitHub Pull Request #352 to fix "buffer" objects
+
+Include https://github.com/paramiko/paramiko/pull/352 patch to
+resolve issue with support passing in "buffer" objects again
+where bytestrings are expected.
+---
+ paramiko/py3compat.py | 4 ++++
+ tests/test_file.py | 10 ++++++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/paramiko/py3compat.py b/paramiko/py3compat.py
+index 8842b98..57c096b 100644
+--- a/paramiko/py3compat.py
++++ b/paramiko/py3compat.py
+@@ -39,6 +39,8 @@ if PY2:
+ return s
+ elif isinstance(s, unicode):
+ return s.encode(encoding)
++ elif isinstance(s, buffer):
++ return s
+ else:
+ raise TypeError("Expected unicode or bytes, got %r" % s)
+
+@@ -49,6 +51,8 @@ if PY2:
+ return s.decode(encoding)
+ elif isinstance(s, unicode):
+ return s
++ elif isinstance(s, buffer):
++ return s.decode(encoding)
+ else:
+ raise TypeError("Expected unicode or bytes, got %r" % s)
+
+diff --git a/tests/test_file.py b/tests/test_file.py
+index c6edd7a..22a34ac 100755
+--- a/tests/test_file.py
++++ b/tests/test_file.py
+@@ -23,6 +23,7 @@ Some unit tests for the BufferedFile abstraction.
+ import unittest
+ from paramiko.file import BufferedFile
+ from paramiko.common import linefeed_byte, crlf, cr_byte
++import sys
+
+
+ class LoopbackFile (BufferedFile):
+@@ -151,6 +152,15 @@ class BufferedFileTest (unittest.TestCase):
+ b'need to close them again.\n')
+ f.close()
+
++ def test_8_buffering(self):
++ """
++ verify that buffered objects can be written
++ """
++ if sys.version_info[0] == 2:
++ f = LoopbackFile('r+', 16)
++ f.write(buffer(b'Too small.'))
++ f.close()
++
+ if __name__ == '__main__':
+ from unittest import main
+ main()
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..14d6d51
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Upstream-GitHub-Pull-Request-352-to-fix-buffer-objec.patch