Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 679628 - >=dev-lang/python-{3.7.6,3.6.8,2.7.16} - test failures due to PermissionError: [Errno 13] Permission denied: '/usr/lib64/pythonX.Y/site-packages/*'
Summary: >=dev-lang/python-{3.7.6,3.6.8,2.7.16} - test failures due to PermissionError...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: TESTFAILURE
: 715402 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-03-06 18:56 UTC by tka
Modified: 2020-04-04 18:22 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz for python-3.6.8 (build.log.xz,20.87 KB, application/x-xz)
2019-03-06 18:56 UTC, tka
Details
build.log.xz for python-2.7.16 (build.log.xz,20.15 KB, application/x-xz)
2019-03-06 19:27 UTC, tka
Details
build.log for python-2.7.17-r2 (build.log,326.20 KB, text/plain)
2020-04-04 17:11 UTC, tka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tka 2019-03-06 18:56:32 UTC
Created attachment 568016 [details]
build.log.xz for python-3.6.8

== Tests result: FAILURE then FAILURE ==

374 tests OK.

6 tests failed:
    test_bdb test_compileall test_import test_runpy test_support
    test_threaded_import

24 tests skipped:
    test_curses test_devpoll test_idle test_kqueue test_msilib
    test_nis test_ossaudiodev test_smtpnet test_socketserver
    test_startfile test_tcl test_timeout test_tix test_tk
    test_ttk_guionly test_ttk_textonly test_turtle test_urllib2net
    test_urllibnet test_winconsoleio test_winreg test_winsound
    test_xmlrpc_net test_zipfile64

6 re-run tests:
    test_bdb test_compileall test_import test_runpy test_support
    test_threaded_import

2 tests run no tests:
    test_dtrace test_future4

Total duration: 2 min 38 sec
Tests result: FAILURE then FAILURE

The tests fail because of a PermissionError for some file under /usr/lib64/python3.6/site-packages/. The particular file varies but the general pattern is always the same. Picking one error as example:

======================================================================
ERROR: test_step_at_return_with_no_trace_in_caller (test.test_bdb.IssuesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.6.8/work/Python-3.6.8/Lib/test/test_bdb.py", line 1009, in test_step_at_return_with_no_trace_in_caller
    tracer.runcall(tfunc_import)
  File "/var/tmp/portage/dev-lang/python-3.6.8/work/Python-3.6.8/Lib/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/var/tmp/portage/dev-lang/python-3.6.8/work/Python-3.6.8/Lib/test/test_bdb.py", line 546, in create_modules
    test.support.forget(m)
  File "/var/tmp/portage/dev-lang/python-3.6.8/work/Python-3.6.8/Lib/test/support/__init__.py", line 462, in forget
    unlink(source + 'c')
  File "/var/tmp/portage/dev-lang/python-3.6.8/work/Python-3.6.8/Lib/test/support/__init__.py", line 422, in unlink
    _unlink(filename)
PermissionError: [Errno 13] Permission denied: '/usr/lib64/python3.6/site-packages/test_module_for_bdb.pyc'

----------------------------------------------------------------------
Comment 1 tka 2019-03-06 18:57:08 UTC
# emerge --info '=dev-lang/python-3.6.8::gentoo'
Portage 2.3.62 (python 3.6.6-final-0, default/linux/amd64/17.0/no-multilib/hardened, gcc-8.3.0, glibc-2.28-r5, 5.0.0 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.0.0-x86_64-Intel-R-_Core-TM-_i7-3720QM_CPU_@_2.60GHz-with-gentoo-2.6
KiB Mem:    16385392 total,   9816076 free
KiB Swap:   17825788 total,  17825788 free
Timestamp of repository gentoo: Wed, 06 Mar 2019 18:00:01 +0000
Head commit of repository gentoo: 85fbaa1a7717c341c235c23d38a5cf05df0a484f
sh bash 5.0_p2
ld GNU ld (Gentoo 2.32 p1) 2.32.0
app-shells/bash:          5.0_p2::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.13.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32::gentoo
sys-devel/gcc:            7.3.0-r6::gentoo, 8.3.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

local
    location: /var/lib/portage-local/local
    masters: gentoo
    priority: 0

testing
    location: /var/lib/portage-local/testing
    masters: gentoo
    priority: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS=""
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 acl acpi alsa amd64 avx bzip2 cairo caps cdda cddb cdparanoia crypt cups cxx dbus dri dts dvd fam ffmpeg fftw flac fontconfig gif gimp gmp gnutls gtk hardened iconv icu idn ipv6 jpeg lame lcms libnotify libtirpc lzma mad matroska mmap mmx mmxext mp3 mpeg ncurses networkmanager nptl ogg opengl openmp pam pcre pie png policykit ppds readline sasl sdl seccomp sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssp ssse3 startup-notification svg test theora threads tiff truetype udev unicode upower vaapi vorbis wayland x264 xattr xcb xinerama xml xtpax xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="i965 intel nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

# emerge -pqv '=dev-lang/python-3.6.8::gentoo'
[ebuild     U ] dev-lang/python-3.6.8 [3.6.6] USE="gdbm hardened ipv6 ncurses readline sqlite ssl test (threads) xml -bluetooth -build -examples -libressl -tk -wininst"
Comment 2 tka 2019-03-06 19:27:20 UTC
Created attachment 568020 [details]
build.log.xz for python-2.7.16

This also happens for dev-lang/python-2.7.16. In this case it is OSError: [Errno 13] Permission denied: '/usr/lib64/python2.7/site-packages/*':

== Tests result: FAILURE then FAILURE ==

357 tests OK.

3 tests failed:
    test_bdb test_runpy test_test_support

42 tests skipped:
    test_aepack test_al test_applesingle test_bsddb test_bsddb185
    test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk
    test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
    test_dl test_gl test_idle test_imageop test_imgfile test_kqueue
    test_linuxaudiodev test_macos test_macostools test_msilib test_nis
    test_ossaudiodev test_scriptpackages test_smtpnet
    test_socketserver test_startfile test_sunaudiodev test_tcl
    test_timeout test_tk test_ttk_guionly test_ttk_textonly
    test_turtle test_urllib2net test_urllibnet test_winreg
    test_winsound test_zipfile64
8 skips unexpected on linux2:
    test_bsddb test_bsddb3 test_idle test_tcl test_tk test_ttk_guionly
    test_ttk_textonly test_turtle

3 re-run tests:
    test_bdb test_runpy test_test_support

Total duration: 7 min 48 sec
Tests result: FAILURE then FAILURE
Comment 3 Mike Gilbert gentoo-dev 2019-03-06 20:15:28 UTC
This likely happened when I dropped the "tests environment" patch. I'll look into it.
Comment 4 Rolf Eike Beer archtester 2019-11-29 15:20:24 UTC
Any news on this? I still had the same errors yesterday.
Comment 5 tka 2019-12-20 11:26:35 UTC
python-3.7.6 is now also affected:

== Tests result: FAILURE then FAILURE ==

383 tests OK.

8 tests failed:
    test_bdb test_compileall test_doctest test_import test_pickle
    test_runpy test_support test_threaded_import

24 tests skipped:
    test_curses test_devpoll test_idle test_kqueue test_msilib
    test_nis test_ossaudiodev test_smtpnet test_socketserver
    test_startfile test_tcl test_timeout test_tix test_tk
    test_ttk_guionly test_ttk_textonly test_turtle test_urllib2net
    test_urllibnet test_winconsoleio test_winreg test_winsound
    test_xmlrpc_net test_zipfile64

8 re-run tests:
    test_bdb test_compileall test_doctest test_import test_pickle
    test_runpy test_support test_threaded_import

Total duration: 8 min 18 sec
Tests result: FAILURE then FAILURE
Comment 6 Rolf Eike Beer archtester 2020-03-04 17:16:22 UTC
Ping?
Comment 7 Mart Raudsepp gentoo-dev 2020-04-03 13:39:17 UTC
still an issue on amd64
Comment 8 Mike Gilbert gentoo-dev 2020-04-03 14:31:47 UTC
*** Bug 715402 has been marked as a duplicate of this bug. ***
Comment 9 Larry the Git Cow gentoo-dev 2020-04-03 14:55:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=212bc8ce91237d28de326e84ff8607863602d1f7

commit 212bc8ce91237d28de326e84ff8607863602d1f7
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-04-03 14:54:43 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-04-03 14:55:52 +0000

    dev-lang/python: ignore EPERM in test.support.unlink()
    
    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>

 .../files/test.support.unlink-ignore-EPERM.patch   | 28 ++++++++++++++++++++++
 ...est.support.unlink-ignore-PermissionError.patch | 28 ++++++++++++++++++++++
 dev-lang/python/python-2.7.17-r1.ebuild            |  1 +
 dev-lang/python/python-3.6.10.ebuild               |  1 +
 dev-lang/python/python-3.7.6.ebuild                |  1 +
 dev-lang/python/python-3.7.7.ebuild                |  1 +
 dev-lang/python/python-3.8.2.ebuild                |  1 +
 dev-lang/python/python-3.9.0_alpha4.ebuild         |  1 +
 dev-lang/python/python-3.9.0_alpha5.ebuild         |  1 +
 9 files changed, 63 insertions(+)
Comment 10 tka 2020-04-04 17:11:39 UTC
Created attachment 630020 [details]
build.log for python-2.7.17-r2

The 3.x versions are fixed now, but python-2.7.17-r2 still fails due to permission errors when trying to unlink files.


== Tests result: FAILURE then FAILURE ==

357 tests OK.

3 tests failed:
    test_bdb test_runpy test_test_support

42 tests skipped:
    test_aepack test_al test_applesingle test_bsddb test_bsddb185
    test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk
    test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
    test_dl test_gl test_idle test_imageop test_imgfile test_kqueue
    test_linuxaudiodev test_macos test_macostools test_msilib test_nis
    test_ossaudiodev test_scriptpackages test_smtpnet
    test_socketserver test_startfile test_sunaudiodev test_tcl
    test_timeout test_tk test_ttk_guionly test_ttk_textonly
    test_turtle test_urllib2net test_urllibnet test_winreg
    test_winsound test_zipfile64
8 skips unexpected on linux2:
    test_bsddb test_bsddb3 test_idle test_tcl test_tk test_ttk_guionly
    test_ttk_textonly test_turtle

3 re-run tests:
    test_bdb test_runpy test_test_support

Total duration: 6 min 45 sec
Tests result: FAILURE then FAILURE
make: *** [Makefile:910: test] Error 2
 * ERROR: dev-lang/python-2.7.17-r2::gentoo failed (test phase):
 *   emake failed


One example of a failing test:

FAILED (errors=1, skipped=1)
test test_test_support failed -- Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-2.7.17-r2/work/Python-2.7.17/Lib/test/test_test_support.py", line 98, in test_forget
    support.forget(TESTFN)
  File "/var/tmp/portage/dev-lang/python-2.7.17-r2/work/Python-2.7.17/Lib/test/support/__init__.py", line 318, in forget
    unlink(os.path.join(dirname, modname + os.extsep + 'pyc'))
  File "/var/tmp/portage/dev-lang/python-2.7.17-r2/work/Python-2.7.17/Lib/test/support/__init__.py", line 292, in unlink
    _unlink(filename)
OSError: [Errno 13] Permission denied: '/usr/lib64/python2.7/site-packages/@test_5622_tmp.pyc'
Comment 11 Mike Gilbert gentoo-dev 2020-04-04 18:15:02 UTC
Oops, I got the wrong errno value. Fix coming up!
Comment 12 Larry the Git Cow gentoo-dev 2020-04-04 18:22:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ddeacea98c15971264056972cd6d03631c73aca

commit 4ddeacea98c15971264056972cd6d03631c73aca
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-04-04 18:21:50 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-04-04 18:22:49 +0000

    dev-lang/python: ignore EACCES instead of EPERM
    
    Fixes: 212bc8ce91237d28de326e84ff8607863602d1f7
    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>

 ...ore-EPERM.patch => test.support.unlink-ignore-EACCES.patch} | 10 +++++-----
 dev-lang/python/python-2.7.17-r2.ebuild                        |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)