Accepting request 760319 from home:stroeder:branches:devel:languages:python

Update to 1.7.2

OBS-URL: https://build.opensuse.org/request/show/760319
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-passlib?expand=0&rev=37
This commit is contained in:
Tomáš Chvátal 2020-01-02 08:55:40 +00:00 committed by Git OBS Bridge
parent 9ce45547c8
commit 52fb1014fd
7 changed files with 29 additions and 133 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d948f64138c25633613f303bcc471126eae67c04d5e3f6b7b8ce6242f8653e0
size 645724

3
passlib-1.7.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d666cef936198bc2ab47ee9b0410c94adf2ba798e5a84bf220be079ae7ab6a8
size 649654

View File

@ -1,47 +0,0 @@
# HG changeset patch
# User Alan Pevec <apevec@redhat.com>
# Date 1562888158 -7200
# Branch stable
# Node ID 98c08467d15759acc3b0f88d2661f6e530147c33
# Parent 27866c441d18c7ce42e3f7afe824f89da4f8d21b
Fix for Python 3.8
This was a deprecation when running in Python 3.7:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
if isinstance(source, collections.Sequence):
diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py
--- a/passlib/utils/__init__.py
+++ b/passlib/utils/__init__.py
@@ -6,7 +6,12 @@
# 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
@@ -276,14 +281,14 @@
"""
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)

View File

@ -1,51 +0,0 @@
# HG changeset patch
# User Alan Pevec <apevec@redhat.com>
# Date 1562844713 -7200
# Branch stable
# Node ID 58f3efd111e930baf39ff50df27ed7f2d24f759d
# Parent 4801587cebf01f5037ddc9cd52fc94708559bbfb
Remove time.clock(), deprecated in 3.8
The function time.clock(), used in passlib/utils/__init__.py
has been removed. It was deprecated since Python 3.3.
More info:
https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals
To make the code both Python 2 and 3 compatible, use timeit.default_timer
diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py
--- a/passlib/utils/__init__.py
+++ b/passlib/utils/__init__.py
@@ -30,6 +30,7 @@
import time
if stringprep:
import unicodedata
+import timeit
import types
from warnings import warn
# site
@@ -839,14 +840,7 @@
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 +897,7 @@
# 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,

View File

@ -1,24 +0,0 @@
Index: passlib-1.7.1/passlib/tests/test_handlers.py
===================================================================
--- passlib-1.7.1.orig/passlib/tests/test_handlers.py
+++ passlib-1.7.1/passlib/tests/test_handlers.py
@@ -176,7 +176,8 @@ class _bsdi_crypt_test(HandlerCase):
platform_crypt_support = [
("freebsd|openbsd|netbsd|darwin", True),
- ("linux|solaris", False),
+ ("solaris", False),
+ # linux - may be present in libxcrypt
]
def test_77_fuzz_input(self, **kwds):
@@ -1253,7 +1254,8 @@ class _sha1_crypt_test(HandlerCase):
platform_crypt_support = [
("netbsd", True),
- ("freebsd|openbsd|linux|solaris|darwin", False),
+ ("freebsd|openbsd|solaris|darwin", False),
+ # linux - may be present in libxcrypt
]
# create test cases for specific backends

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Wed Jan 1 22:15:42 UTC 2020 - Michael Ströder <michael@stroeder.com>
- Removed obsolete patches:
* python-passlib-1.7.1-libxcrypt-compat.patch
* pr_9_1.patch and pr_9_2.patch
- Update to 1.7.2
* New Features
- argon2: Now supports Argon2 “ID” and “D” hashes
(assuming new enough backend library).
- scrypt: Now uses python 3.6 stdlibs hashlib.scrypt() as backend,
if present (issue 86).
* Bugfixes
- Python 3.8 compatibility fixes
- passlib.apache.HtpasswdFile:
Now generates bcrypt hashes using the "$2y$" prefix, which should work
properly with Apache 2.4s htpasswd tool.
- passlib.totp: The TOTP.to_uri() method now prepends the issuer to URI label,
(per the KeyURI spec). This should fix some compatibility issues with
older TOTP clients (issue 92)
- Fixed error in argon2.parsehash() (issue 97)
- unittests: crypt() unittests now account for linux systems running
libxcrypt (such as recent Fedora releases)
-------------------------------------------------------------------
Thu Oct 3 15:09:46 UTC 2019 - John Vandenberg <jayvdb@gmail.com>

View File

@ -18,17 +18,13 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-passlib
Version: 1.7.1
Version: 1.7.2
Release: 0
Summary: Password hashing framework supporting over 20 schemes
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://bitbucket.org/ecollins/passlib
Source: https://files.pythonhosted.org/packages/source/p/passlib/passlib-%{version}.tar.gz
Patch0: python-passlib-1.7.1-libxcrypt-compat.patch
# Python 3.8 compatibility patches
Patch1: pr_9_1.patch
Patch2: pr_9_2.patch
# test requirements
BuildRequires: %{python_module nose}
BuildRequires: %{python_module setuptools}
@ -46,9 +42,6 @@ applications.
%prep
%setup -q -n passlib-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%python_build