dev-lang/python: ignore EPERM in test.support.unlink()
authorMike Gilbert <floppym@gentoo.org>
Fri, 3 Apr 2020 14:54:43 +0000 (10:54 -0400)
committerMike Gilbert <floppym@gentoo.org>
Fri, 3 Apr 2020 14:55:52 +0000 (10:55 -0400)
Closes: https://bugs.gentoo.org/679628
Package-Manager: Portage-2.3.96_p4, Repoman-2.3.22_p1
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
dev-lang/python/files/test.support.unlink-ignore-EPERM.patch [new file with mode: 0644]
dev-lang/python/files/test.support.unlink-ignore-PermissionError.patch [new file with mode: 0644]
dev-lang/python/python-2.7.17-r1.ebuild
dev-lang/python/python-3.6.10.ebuild
dev-lang/python/python-3.7.6.ebuild
dev-lang/python/python-3.7.7.ebuild
dev-lang/python/python-3.8.2.ebuild
dev-lang/python/python-3.9.0_alpha4.ebuild
dev-lang/python/python-3.9.0_alpha5.ebuild

diff --git a/dev-lang/python/files/test.support.unlink-ignore-EPERM.patch b/dev-lang/python/files/test.support.unlink-ignore-EPERM.patch
new file mode 100644 (file)
index 0000000..2913981
--- /dev/null
@@ -0,0 +1,28 @@
+From 789c61e1a1966241d274012cdbd5fb9716448952 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 3 Apr 2020 10:37:56 -0400
+Subject: [PATCH] test.support.unlink: ignore EPERM
+
+Resolves test errors when running in the Gentoo sandbox environment.
+
+Bug: https://bugs.gentoo.org/679628
+---
+ Lib/test/support/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
+index ccc11c1b4b0..c5ec06bb420 100644
+--- a/Lib/test/support/__init__.py
++++ b/Lib/test/support/__init__.py
+@@ -291,7 +291,7 @@ def unlink(filename):
+     try:
+         _unlink(filename)
+     except OSError as exc:
+-        if exc.errno not in (errno.ENOENT, errno.ENOTDIR):
++        if exc.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EPERM):
+             raise
+ def rmdir(dirname):
+-- 
+2.26.0
+
diff --git a/dev-lang/python/files/test.support.unlink-ignore-PermissionError.patch b/dev-lang/python/files/test.support.unlink-ignore-PermissionError.patch
new file mode 100644 (file)
index 0000000..6cae17b
--- /dev/null
@@ -0,0 +1,28 @@
+From 6e6402caa7962a9c9f7c5327f3c802545824f7f9 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 3 Apr 2020 10:37:56 -0400
+Subject: [PATCH] test.support.unlink: ignore PermissionError
+
+Resolves test errors when running in the Gentoo sandbox environment.
+
+Bug: https://bugs.gentoo.org/679628
+---
+ Lib/test/support/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
+index 1f792d8514d..a0772480eb4 100644
+--- a/Lib/test/support/__init__.py
++++ b/Lib/test/support/__init__.py
+@@ -488,7 +488,7 @@ else:
+ def unlink(filename):
+     try:
+         _unlink(filename)
+-    except (FileNotFoundError, NotADirectoryError):
++    except (FileNotFoundError, NotADirectoryError, PermissionError):
+         pass
+ def rmdir(dirname):
+-- 
+2.26.0
+
index 87a23fa5fb6ccb5605a6d95d8a0b9fa8b6746882..f38156d7d51baf50f6910e12960e5dd4904a3df9 100644 (file)
@@ -88,6 +88,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-EPERM.patch"
        )
 
        default
index fabe76bc113ad3b94dc503d49c5f41304c86e768..c572c8146d023a88e59a8cbadf1336c42d085b44 100644 (file)
@@ -65,6 +65,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default
index 35666215d46379c90a0079cd732501bb3cb2ec73..8f29c79414d4ba00d248ba505d13fc876170a276 100644 (file)
@@ -66,6 +66,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default
index 07492f4fb2a3110ea3ff0a9457fb7ea1a00205f1..d57ddee45e636dd4c311332dde099a10ddf7073f 100644 (file)
@@ -66,6 +66,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default
index edf2079cfe597436e355dc31e42cb62b32b2f6f3..35d43534599575c7684f2e89120774d697c63671 100644 (file)
@@ -66,6 +66,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default
index c0e9c0256eb01a0ab3f4adfc36f3ae49478f3980..49d4c9d5f87775bf469f0ed13d937b781ec59492 100644 (file)
@@ -82,6 +82,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default
index c0e9c0256eb01a0ab3f4adfc36f3ae49478f3980..49d4c9d5f87775bf469f0ed13d937b781ec59492 100644 (file)
@@ -82,6 +82,7 @@ src_prepare() {
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
+               "${FILESDIR}/test.support.unlink-ignore-PermissionError.patch"
        )
 
        default