summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-26 17:29:27 +0200
committerMichał Górny <mgorny@gentoo.org>2020-05-26 18:36:03 +0200
commit14e42da7759f4b774dfd521de69728cfd805678f (patch)
tree910243b933956f29fc890fff90fd60a2f1eea4e2 /dev-python/passlib
parentdev-python/webencodings: Use HTTPS (diff)
downloadgentoo-14e42da7759f4b774dfd521de69728cfd805678f.tar.gz
gentoo-14e42da7759f4b774dfd521de69728cfd805678f.tar.bz2
gentoo-14e42da7759f4b774dfd521de69728cfd805678f.zip
dev-python/passlib: Port to py39
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/passlib')
-rw-r--r--dev-python/passlib/files/passlib-1.7.2-py39.patch19
-rw-r--r--dev-python/passlib/passlib-1.7.2.ebuild11
2 files changed, 27 insertions, 3 deletions
diff --git a/dev-python/passlib/files/passlib-1.7.2-py39.patch b/dev-python/passlib/files/passlib-1.7.2-py39.patch
new file mode 100644
index 000000000000..c5dbc208a88b
--- /dev/null
+++ b/dev-python/passlib/files/passlib-1.7.2-py39.patch
@@ -0,0 +1,19 @@
+diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py
+index 69b55e5..d18ec50 100644
+--- a/passlib/utils/__init__.py
++++ b/passlib/utils/__init__.py
+@@ -807,7 +807,13 @@ else:
+
+ if isinstance(hash, bytes):
+ hash = hash.decode("ascii")
+- result = _crypt(secret, hash)
++ try:
++ result = _crypt(secret, hash)
++ except OSError:
++ # new in py39 -- per https://bugs.python.org/issue39289,
++ # crypt() now throws OSError for various things, mainly unknown hash formats
++ # translating that to None for now (may revise safe_crypt behavior in future)
++ return None
+ if PYPY and isinstance(result, bytes):
+ result = result.decode("utf-8")
+ if not result or result[0:1] in _invalid_prefixes:
diff --git a/dev-python/passlib/passlib-1.7.2.ebuild b/dev-python/passlib/passlib-1.7.2.ebuild
index aaa2485c0159..da3cd45d5bee 100644
--- a/dev-python/passlib/passlib-1.7.2.ebuild
+++ b/dev-python/passlib/passlib-1.7.2.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
inherit distutils-r1
@@ -18,11 +18,16 @@ IUSE="+bcrypt doc +scrypt +totp"
RDEPEND="bcrypt? ( dev-python/bcrypt[${PYTHON_USEDEP}] )
totp? ( dev-python/cryptography[${PYTHON_USEDEP}] )
scrypt? ( dev-python/scrypt[${PYTHON_USEDEP}] )"
-DEPEND="${RDEPEND}
- dev-python/setuptools[${PYTHON_USEDEP}]"
+BDEPEND="
+ test? (
+ dev-python/bcrypt[${PYTHON_USEDEP}]
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ dev-python/scrypt[${PYTHON_USEDEP}]
+ )"
PATCHES=(
"${FILESDIR}/passlib-1.7.2-pypy3.patch"
+ "${FILESDIR}/passlib-1.7.2-py39.patch"
)
distutils_enable_tests nose