Hello community,

here is the log from the commit of package python-aiorpcX for openSUSE:Factory 
checked in at 2020-01-17 16:08:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-aiorpcX (Old)
 and      /work/SRC/openSUSE:Factory/.python-aiorpcX.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-aiorpcX"

Fri Jan 17 16:08:20 2020 rev:5 rq:765074 version:0.18.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-aiorpcX/python-aiorpcX.changes    
2019-07-31 14:37:19.897834666 +0200
+++ /work/SRC/openSUSE:Factory/.python-aiorpcX.new.26092/python-aiorpcX.changes 
2020-01-17 16:08:30.400528590 +0100
@@ -1,0 +2,8 @@
+Thu Jan 16 16:55:12 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 0.18.4
+  * handle time.time() not making progress
+  * handle SOCKSError in _connect_one 
+  * socks.py: Add SOCKSRandomAuth
+
+-------------------------------------------------------------------

Old:
----
  0.18.3.tar.gz

New:
----
  0.18.4.tar.gz

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

Other differences:
------------------
++++++ python-aiorpcX.spec ++++++
--- /var/tmp/diff_new_pack.TK7N6c/_old  2020-01-17 16:08:31.280529007 +0100
+++ /var/tmp/diff_new_pack.TK7N6c/_new  2020-01-17 16:08:31.288529010 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-aiorpcX
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-aiorpcX
-Version:        0.18.3
+Version:        0.18.4
 Release:        0
 Summary:        Generic async RPC implementation, including JSON-RPC
 License:        MIT

++++++ 0.18.3.tar.gz -> 0.18.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/aiorpcx/__init__.py 
new/aiorpcX-0.18.4/aiorpcx/__init__.py
--- old/aiorpcX-0.18.3/aiorpcx/__init__.py      2019-05-27 19:26:23.000000000 
+0200
+++ new/aiorpcX-0.18.4/aiorpcx/__init__.py      2019-11-20 19:02:43.000000000 
+0100
@@ -8,7 +8,7 @@
 from .websocket import *
 
 
-_version_str = '0.18.3'
+_version_str = '0.18.4'
 _version = tuple(int(part) for part in _version_str.split('.'))
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/aiorpcx/jsonrpc.py 
new/aiorpcX-0.18.4/aiorpcx/jsonrpc.py
--- old/aiorpcX-0.18.3/aiorpcx/jsonrpc.py       2019-05-27 19:26:23.000000000 
+0200
+++ new/aiorpcX-0.18.4/aiorpcx/jsonrpc.py       2019-11-20 19:02:43.000000000 
+0100
@@ -35,7 +35,6 @@
 from numbers import Number
 
 from asyncio import get_event_loop
-from aiorpcx import CancelledError
 from aiorpcx.util import signature_info
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/aiorpcx/session.py 
new/aiorpcX-0.18.4/aiorpcx/session.py
--- old/aiorpcX-0.18.3/aiorpcx/session.py       2019-05-27 19:26:23.000000000 
+0200
+++ new/aiorpcX-0.18.4/aiorpcx/session.py       2019-11-20 19:02:43.000000000 
+0100
@@ -420,7 +420,11 @@
         current = self._outgoing_concurrency.max_concurrent
         cap = min(current + max(3, current * 0.1), 250)
         floor = max(1, min(current * 0.8, current - 1))
-        target = int(0.5 + max(floor, min(cap, current * 
self.target_response_time / avg)))
+        if avg != 0:
+            target = max(floor, min(cap, current * self.target_response_time / 
avg))
+        else:
+            target = cap
+        target = int(0.5 + target)
         if target != current:
             self.logger.info(f'changing outgoing request concurrency to 
{target} from {current}')
             self._outgoing_concurrency.set_target(target)
@@ -494,7 +498,7 @@
                 async with timeout_after(self.sent_request_timeout):
                     return await future
             finally:
-                time_taken = time.time() - send_time
+                time_taken = max(0, time.time() - send_time)
                 if request_count == 1:
                     self._req_times.append(time_taken)
                 else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/aiorpcx/socks.py 
new/aiorpcX-0.18.4/aiorpcx/socks.py
--- old/aiorpcX-0.18.3/aiorpcx/socks.py 2019-05-27 19:26:23.000000000 +0200
+++ new/aiorpcX-0.18.4/aiorpcx/socks.py 2019-11-20 19:02:43.000000000 +0100
@@ -28,6 +28,7 @@
 import asyncio
 import collections
 from ipaddress import IPv4Address, IPv6Address
+import secrets
 import socket
 import struct
 from functools import partial
@@ -35,13 +36,22 @@
 from aiorpcx.util import NetAddress
 
 
-__all__ = ('SOCKSUserAuth', 'SOCKS4', 'SOCKS4a', 'SOCKS5', 'SOCKSProxy',
+__all__ = ('SOCKSUserAuth', 'SOCKSRandomAuth', 'SOCKS4', 'SOCKS4a', 'SOCKS5', 
'SOCKSProxy',
            'SOCKSError', 'SOCKSProtocolError', 'SOCKSFailure')
 
 
 SOCKSUserAuth = collections.namedtuple("SOCKSUserAuth", "username password")
 
 
+# Random authentication is useful when used with Tor for stream isolation.
+class SOCKSRandomAuth(SOCKSUserAuth):
+    def __getitem__(self, key):
+        return secrets.token_hex(32)
+
+
+SOCKSRandomAuth.__new__.__defaults__ = (None, None)
+
+
 class SOCKSError(Exception):
     '''Base class for SOCKS exceptions.  Each raised exception will be
     an instance of a derived class.'''
@@ -316,7 +326,7 @@
                 await self._handshake(client, sock, loop)
                 self.peername = sock.getpeername()
                 return sock
-            except (OSError, SOCKSProtocolError) as e:
+            except (OSError, SOCKSError) as e:
                 exception = e
                 # Don't close the socket because of an asyncio bug
                 # see https://github.com/kyuupichan/aiorpcX/issues/8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/docs/changelog.rst 
new/aiorpcX-0.18.4/docs/changelog.rst
--- old/aiorpcX-0.18.3/docs/changelog.rst       2019-05-27 19:26:23.000000000 
+0200
+++ new/aiorpcX-0.18.4/docs/changelog.rst       2019-11-20 19:02:43.000000000 
+0100
@@ -5,6 +5,13 @@
           for a 1.0 release in the coming months.
 
 
+Version 0.18.4 (20 Nov 2019)
+----------------------------
+
+* handle time.time() not making progress. fixing `#26`_  (SomberNight)
+* handle SOCKSError in _connect_one (SomberNight)
+* add SOCKSRandomAuth: Jeremy Rand
+
 Version 0.18.3 (19 May 2019)
 ----------------------------
 
@@ -305,3 +312,4 @@
 .. _#8: https://github.com/kyuupichan/aiorpcX/issues/8
 .. _#10: https://github.com/kyuupichan/aiorpcX/issues/10
 .. _#22: https://github.com/kyuupichan/aiorpcX/issues/22
+.. _#26: https://github.com/kyuupichan/aiorpcX/issues/26
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aiorpcX-0.18.3/tests/test_socks.py 
new/aiorpcX-0.18.4/tests/test_socks.py
--- old/aiorpcX-0.18.3/tests/test_socks.py      2019-05-27 19:26:23.000000000 
+0200
+++ new/aiorpcX-0.18.4/tests/test_socks.py      2019-11-20 19:02:43.000000000 
+0100
@@ -629,6 +629,33 @@
         p = SOCKSProxy(address, SOCKS5, auth_methods[1])
         assert str(p) == f'SOCKS5 proxy at {address}, auth: username'
 
+    def test_random(self):
+        auth1 = auth_methods[1]
+        auth2 = SOCKSRandomAuth()
+
+        # SOCKSRandomAuth is a SOCKSUserAuth
+        assert isinstance(auth2, SOCKSUserAuth)
+
+        # Username of SOCKSUserAuth should be constant
+        user1a = auth1.username
+        user1b = auth1.username
+        assert user1a == user1b
+
+        # Password of SOCKSUserAuth should be constant
+        pass1a = auth1.password
+        pass1b = auth1.password
+        assert pass1a == pass1b
+
+        # Username of SOCKSRandomAuth should be random
+        user2a = auth2.username
+        user2b = auth2.username
+        assert user2a != user2b
+
+        # Password of SOCKSRandomAuth should be random
+        pass2a = auth2.password
+        pass2b = auth2.password
+        assert pass2a != pass2b
+
 
 def test_basic():
     assert issubclass(SOCKSProtocolError, SOCKSError)


Reply via email to