Hello community,

here is the log from the commit of package python-scp for openSUSE:Factory 
checked in at 2019-03-26 15:44:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-scp (Old)
 and      /work/SRC/openSUSE:Factory/.python-scp.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-scp"

Tue Mar 26 15:44:53 2019 rev:4 rq:688278 version:0.13.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-scp/python-scp.changes    2019-03-14 
15:01:14.331696844 +0100
+++ /work/SRC/openSUSE:Factory/.python-scp.new.25356/python-scp.changes 
2019-03-26 15:44:59.484109796 +0100
@@ -1,0 +2,7 @@
+Mon Mar 25 13:59:28 UTC 2019 - [email protected]
+
+- version update to 0.13.2
+  *  Fix AssertionError in recursive get() when `_rename` is set and
+     server sends a POPD at the end (`_depth > 0`)
+
+-------------------------------------------------------------------

Old:
----
  scp-0.13.0.tar.gz

New:
----
  scp-0.13.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-scp.spec ++++++
--- /var/tmp/diff_new_pack.eOj5Io/_old  2019-03-26 15:45:00.892108146 +0100
+++ /var/tmp/diff_new_pack.eOj5Io/_new  2019-03-26 15:45:00.916108117 +0100
@@ -19,7 +19,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-scp
-Version:        0.13.0
+Version:        0.13.2
 Release:        0
 Summary:        SSH scp module for paramiko
 License:        LGPL-2.1-or-later

++++++ scp-0.13.0.tar.gz -> scp-0.13.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/CHANGELOG.md new/scp-0.13.2/CHANGELOG.md
--- old/scp-0.13.0/CHANGELOG.md 2018-11-12 21:53:11.000000000 +0100
+++ new/scp-0.13.2/CHANGELOG.md 2019-03-20 04:28:02.000000000 +0100
@@ -1,5 +1,13 @@
 # Changelog
 
+## 0.13.2 (2019-03-19)
+
+- Fix AssertionError in recursive get() when `_rename` is set and server sends 
a POPD at the end (`_depth > 0`)
+
+## 0.13.1 (2019-03-11)
+
+- Guard against some malformed messages from the server
+
 ## 0.13.0 (2018-11-12)
 
 - Remove all introspection logic for `progress` callback introduced in 0.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/PKG-INFO new/scp-0.13.2/PKG-INFO
--- old/scp-0.13.0/PKG-INFO     2018-11-12 21:55:19.000000000 +0100
+++ new/scp-0.13.2/PKG-INFO     2019-03-20 04:29:26.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: scp
-Version: 0.13.0
+Version: 0.13.2
 Summary: scp module for paramiko
 Home-page: https://github.com/jbardin/scp.py
 Author: James Bardin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/scp.egg-info/PKG-INFO 
new/scp-0.13.2/scp.egg-info/PKG-INFO
--- old/scp-0.13.0/scp.egg-info/PKG-INFO        2018-11-12 21:55:19.000000000 
+0100
+++ new/scp-0.13.2/scp.egg-info/PKG-INFO        2019-03-20 04:29:26.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: scp
-Version: 0.13.0
+Version: 0.13.2
 Summary: scp module for paramiko
 Home-page: https://github.com/jbardin/scp.py
 Author: James Bardin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/scp.py new/scp-0.13.2/scp.py
--- old/scp-0.13.0/scp.py       2018-11-12 21:53:50.000000000 +0100
+++ new/scp-0.13.2/scp.py       2019-03-20 04:28:16.000000000 +0100
@@ -5,7 +5,7 @@
 Utilities for sending files over ssh using the scp1 protocol.
 """
 
-__version__ = '0.13.0'
+__version__ = '0.13.2'
 
 import locale
 import os
@@ -117,6 +117,7 @@
         else:
             self._progress = None
         self._recv_dir = b''
+        self._depth = 0
         self._rename = False
         self._utime = None
         self.sanitize = sanitize
@@ -214,6 +215,7 @@
             remote_path = [remote_path]
         remote_path = [self.sanitize(asbytes(r)) for r in remote_path]
         self._recv_dir = local_path or os.getcwd()
+        self._depth = 0
         self._rename = (len(remote_path) == 1 and
                         not os.path.isdir(os.path.abspath(local_path)))
         if len(remote_path) > 1:
@@ -410,11 +412,13 @@
                 path = self._recv_dir
                 self._rename = False
             elif os.name == 'nt':
-                path = os.path.join(asunicode_win(self._recv_dir),
-                                    parts[2].decode('utf-8'))
+                name = parts[2].decode('utf-8')
+                assert not os.path.isabs(name)
+                path = os.path.join(asunicode_win(self._recv_dir), name)
             else:
-                path = os.path.join(asbytes(self._recv_dir),
-                                    parts[2])
+                name = parts[2]
+                assert not os.path.isabs(name)
+                path = os.path.join(asbytes(self._recv_dir), name)
         except:
             chan.send('\x01')
             chan.close()
@@ -470,11 +474,15 @@
                 path = self._recv_dir
                 self._rename = False
             elif os.name == 'nt':
-                path = os.path.join(asunicode_win(self._recv_dir),
-                                    parts[2].decode('utf-8'))
+                name = parts[2].decode('utf-8')
+                assert not os.path.isabs(name)
+                path = os.path.join(asunicode_win(self._recv_dir), name)
+                self._depth += 1
             else:
-                path = os.path.join(asbytes(self._recv_dir),
-                                    parts[2])
+                name = parts[2]
+                assert not os.path.isabs(name)
+                path = os.path.join(asbytes(self._recv_dir), name)
+                self._depth += 1
         except:
             self.channel.send(b'\x01')
             raise SCPException('Bad directory format')
@@ -493,7 +501,9 @@
             raise
 
     def _recv_popd(self, *cmd):
-        self._recv_dir = os.path.split(self._recv_dir)[0]
+        if self._depth > 0:
+            self._depth -= 1
+            self._recv_dir = os.path.split(self._recv_dir)[0]
 
     def _set_dirtimes(self):
         try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/setup.py new/scp-0.13.2/setup.py
--- old/scp-0.13.0/setup.py     2018-11-12 21:53:43.000000000 +0100
+++ new/scp-0.13.2/setup.py     2019-03-20 04:28:21.000000000 +0100
@@ -10,7 +10,7 @@
     description = fp.read()
 setup(
         name = 'scp',
-        version = '0.13.0',
+        version = '0.13.2',
         author = 'James Bardin',
         author_email = '[email protected]',
         license = 'LGPL',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scp-0.13.0/test.py new/scp-0.13.2/test.py
--- old/scp-0.13.0/test.py      2018-11-12 21:51:26.000000000 +0100
+++ new/scp-0.13.2/test.py      2019-03-20 04:25:25.000000000 +0100
@@ -159,6 +159,11 @@
                             u'bien rang\xE9\\b\xE8te'],
                            [b'bien rang\xC3\xA9', b'bien rang\xC3\xA9/file',
                             b'bien rang\xC3\xA9/b\xC3\xA8te'])
+        self.download_test(b'/tmp/bien rang\xC3\xA9', True, b'target',
+                           [u'target', u'target\\file',
+                            u'target\\b\xE8te'],
+                           [b'target', b'target/file',
+                            b'target/b\xC3\xA8te'])
 
     def test_get_invalid_unicode(self):
         self.download_test(b'/tmp/p\xE9t\xE9', False, u'target',
@@ -309,7 +314,8 @@
             put(self.ssh.get_transport(), testfile, testfile_sent)
             get(self.ssh.get_transport(), testfile_sent, testfile_rcvd)
 
-            assert open(testfile_rcvd).read() == 'TESTING\n'
+            with open(testfile_rcvd) as f:
+                self.assertEqual(f.read(), 'TESTING\n')
         finally:
             os.chdir(previous)
 


Reply via email to