1 |
commit: 14e42da7759f4b774dfd521de69728cfd805678f |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 26 15:29:27 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 26 16:36:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14e42da7 |
7 |
|
8 |
dev-python/passlib: Port to py39 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/passlib/files/passlib-1.7.2-py39.patch | 19 +++++++++++++++++++ |
13 |
dev-python/passlib/passlib-1.7.2.ebuild | 11 ++++++++--- |
14 |
2 files changed, 27 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/passlib/files/passlib-1.7.2-py39.patch b/dev-python/passlib/files/passlib-1.7.2-py39.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..c5dbc208a88 |
19 |
--- /dev/null |
20 |
+++ b/dev-python/passlib/files/passlib-1.7.2-py39.patch |
21 |
@@ -0,0 +1,19 @@ |
22 |
+diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py |
23 |
+index 69b55e5..d18ec50 100644 |
24 |
+--- a/passlib/utils/__init__.py |
25 |
++++ b/passlib/utils/__init__.py |
26 |
+@@ -807,7 +807,13 @@ else: |
27 |
+ |
28 |
+ if isinstance(hash, bytes): |
29 |
+ hash = hash.decode("ascii") |
30 |
+- result = _crypt(secret, hash) |
31 |
++ try: |
32 |
++ result = _crypt(secret, hash) |
33 |
++ except OSError: |
34 |
++ # new in py39 -- per https://bugs.python.org/issue39289, |
35 |
++ # crypt() now throws OSError for various things, mainly unknown hash formats |
36 |
++ # translating that to None for now (may revise safe_crypt behavior in future) |
37 |
++ return None |
38 |
+ if PYPY and isinstance(result, bytes): |
39 |
+ result = result.decode("utf-8") |
40 |
+ if not result or result[0:1] in _invalid_prefixes: |
41 |
|
42 |
diff --git a/dev-python/passlib/passlib-1.7.2.ebuild b/dev-python/passlib/passlib-1.7.2.ebuild |
43 |
index aaa2485c015..da3cd45d5be 100644 |
44 |
--- a/dev-python/passlib/passlib-1.7.2.ebuild |
45 |
+++ b/dev-python/passlib/passlib-1.7.2.ebuild |
46 |
@@ -2,7 +2,7 @@ |
47 |
# Distributed under the terms of the GNU General Public License v2 |
48 |
|
49 |
EAPI=7 |
50 |
-PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 ) |
51 |
+PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 ) |
52 |
|
53 |
inherit distutils-r1 |
54 |
|
55 |
@@ -18,11 +18,16 @@ IUSE="+bcrypt doc +scrypt +totp" |
56 |
RDEPEND="bcrypt? ( dev-python/bcrypt[${PYTHON_USEDEP}] ) |
57 |
totp? ( dev-python/cryptography[${PYTHON_USEDEP}] ) |
58 |
scrypt? ( dev-python/scrypt[${PYTHON_USEDEP}] )" |
59 |
-DEPEND="${RDEPEND} |
60 |
- dev-python/setuptools[${PYTHON_USEDEP}]" |
61 |
+BDEPEND=" |
62 |
+ test? ( |
63 |
+ dev-python/bcrypt[${PYTHON_USEDEP}] |
64 |
+ dev-python/cryptography[${PYTHON_USEDEP}] |
65 |
+ dev-python/scrypt[${PYTHON_USEDEP}] |
66 |
+ )" |
67 |
|
68 |
PATCHES=( |
69 |
"${FILESDIR}/passlib-1.7.2-pypy3.patch" |
70 |
+ "${FILESDIR}/passlib-1.7.2-py39.patch" |
71 |
) |
72 |
|
73 |
distutils_enable_tests nose |