Package: python-passlib
Version: 1.7.1-1
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch

The package fails to build with python 3.8, the attached patch fixes the
issue
diff -Nru python-passlib-1.7.1/debian/changelog python-passlib-1.7.1/debian/changelog
--- python-passlib-1.7.1/debian/changelog	2017-01-31 17:48:36.000000000 +0100
+++ python-passlib-1.7.1/debian/changelog	2019-12-19 18:46:11.000000000 +0100
@@ -1,3 +1,10 @@
+python-passlib (1.7.1-2) UNRELEASED; urgency=medium
+
+  * debian/patches/hg_python38_build.patch:
+    - backport some python 3.8 fixes from the upstream vcs
+
+ -- Sebastien Bacher <seb...@ubuntu.com>  Thu, 19 Dec 2019 18:43:51 +0100
+
 python-passlib (1.7.1-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru python-passlib-1.7.1/debian/patches/hg_python38_build.patch python-passlib-1.7.1/debian/patches/hg_python38_build.patch
--- python-passlib-1.7.1/debian/patches/hg_python38_build.patch	1970-01-01 01:00:00.000000000 +0100
+++ python-passlib-1.7.1/debian/patches/hg_python38_build.patch	2019-12-19 18:45:41.000000000 +0100
@@ -0,0 +1,71 @@
+# Description: python3.8 compat fixes
+# https://bitbucket.org/ecollins/passlib/commits/844b76a82d5b
+#
+Index: python-passlib-1.7.1/passlib/utils/__init__.py
+===================================================================
+--- python-passlib-1.7.1.orig/passlib/utils/__init__.py
++++ python-passlib-1.7.1/passlib/utils/__init__.py
+@@ -6,7 +6,12 @@ from passlib.utils.compat import JYTHON
+ # core
+ from binascii import b2a_base64, a2b_base64, Error as _BinAsciiError
+ from base64 import b64encode, b64decode
+-import collections
++try:
++    from collections.abc import Sequence
++    from collections.abc import Iterable
++except ImportError:
++    from collections import Sequence
++    from collections import Iterable
+ from codecs import lookup as _lookup_codec
+ from functools import update_wrapper
+ import itertools
+@@ -30,6 +35,7 @@ else:
+ import time
+ if stringprep:
+     import unicodedata
++import timeit
+ import types
+ from warnings import warn
+ # site
+@@ -275,14 +281,14 @@ def batch(source, size):
+     """
+     if size < 1:
+         raise ValueError("size must be positive integer")
+-    if isinstance(source, collections.Sequence):
++    if isinstance(source, Sequence):
+         end = len(source)
+         i = 0
+         while i < end:
+             n = i + size
+             yield source[i:n]
+             i = n
+-    elif isinstance(source, collections.Iterable):
++    elif isinstance(source, Iterable):
+         itr = iter(source)
+         while True:
+             chunk_itr = itertools.islice(itr, size)
+@@ -839,14 +845,7 @@ def test_crypt(secret, hash):
+     assert secret and hash
+     return safe_crypt(secret, hash) == hash
+ 
+-# pick best timer function to expose as "tick" - lifted from timeit module.
+-if sys.platform == "win32":
+-    # On Windows, the best timer is time.clock()
+-    from time import clock as timer
+-else:
+-    # On most other platforms the best timer is time.time()
+-    from time import time as timer
+-
++timer = timeit.default_timer
+ # legacy alias, will be removed in passlib 2.0
+ tick = timer
+ 
+@@ -903,7 +902,7 @@ def genseed(value=None):
+ 
+         # the current time, to whatever precision os uses
+         time.time(),
+-        time.clock(),
++        tick(),
+ 
+         # if urandom available, might as well mix some bytes in.
+         os.urandom(32).decode("latin-1") if has_urandom else 0,
diff -Nru python-passlib-1.7.1/debian/patches/series python-passlib-1.7.1/debian/patches/series
--- python-passlib-1.7.1/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ python-passlib-1.7.1/debian/patches/series	2019-12-19 18:42:17.000000000 +0100
@@ -0,0 +1 @@
+hg_python38_build.patch
_______________________________________________
Python-modules-team mailing list
Python-modules-team@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to