RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1814392 - test_site is failing on an installed python3
Summary: test_site is failing on an installed python3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: python3
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Charalampos Stratakis
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks: 1815643 1815645
TreeView+ depends on / blocked
 
Reported: 2020-03-17 18:37 UTC by Charalampos Stratakis
Modified: 2020-11-04 01:32 UTC (History)
3 users (show)

Fixed In Version: python3-3.6.8-26.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1815643 1815645 (view as bug list)
Environment:
Last Closed: 2020-11-04 01:30:33 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 27807 0 None None None 2020-03-18 15:00:43 UTC
Red Hat Product Errata RHSA-2020:4433 0 None None None 2020-11-04 01:31:03 UTC

Description Charalampos Stratakis 2020-03-17 18:37:57 UTC
Installing python3-test and running '$ python3 -m test -vv test_site' on the latest RHEL 8.2 compose and above produces the following traceback

This also happens on RHEL 8.1.1 but NOT on on 8.1.0 or the earlier composes of 8.2.0. On the available ones I can notice the failure initially on RHEL-8.2.0-20200225.0 and not on the previous one RHEL-8.2.0-20191219.0

======================================================================
FAIL: test_startup_imports (test.test_site.StartupImportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.6/test/test_site.py", line 532, in test_startup_imports
    self.assertFalse(modules.intersection(collection_mods), stderr)
AssertionError: {'heapq', 'collections', 'types', 'keyword', 'functools', 'weakref', 'operator', 'reprlib'} is not false : import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# /usr/lib64/python3.6/encodings/__pycache__/__init__.cpython-36.pyc matches /usr/lib64/python3.6/encodings/__init__.py
# code object from '/usr/lib64/python3.6/encodings/__pycache__/__init__.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/codecs.cpython-36.pyc matches /usr/lib64/python3.6/codecs.py
# code object from '/usr/lib64/python3.6/__pycache__/codecs.cpython-36.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab202e80>
# /usr/lib64/python3.6/encodings/__pycache__/aliases.cpython-36.pyc matches /usr/lib64/python3.6/encodings/aliases.py
# code object from '/usr/lib64/python3.6/encodings/__pycache__/aliases.cpython-36.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab198860>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab2029e8>
# /usr/lib64/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc matches /usr/lib64/python3.6/encodings/utf_8.py
# code object from '/usr/lib64/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1a6668>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc matches /usr/lib64/python3.6/encodings/latin_1.py
# code object from '/usr/lib64/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1ac198>
# /usr/lib64/python3.6/__pycache__/io.cpython-36.pyc matches /usr/lib64/python3.6/io.py
# code object from '/usr/lib64/python3.6/__pycache__/io.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/abc.cpython-36.pyc matches /usr/lib64/python3.6/abc.py
# code object from '/usr/lib64/python3.6/__pycache__/abc.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/_weakrefset.cpython-36.pyc matches /usr/lib64/python3.6/_weakrefset.py
# code object from '/usr/lib64/python3.6/__pycache__/_weakrefset.cpython-36.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1b2128>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1ac780>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1ac3c8>
# /usr/lib64/python3.6/__pycache__/_bootlocale.cpython-36.pyc matches /usr/lib64/python3.6/_bootlocale.py
# code object from '/usr/lib64/python3.6/__pycache__/_bootlocale.cpython-36.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1b7898>
Python 3.6.8 (default, Dec  5 2019, 15:45:45) 
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
# /usr/lib64/python3.6/__pycache__/site.cpython-36.pyc matches /usr/lib64/python3.6/site.py
# code object from '/usr/lib64/python3.6/__pycache__/site.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/os.cpython-36.pyc matches /usr/lib64/python3.6/os.py
# code object from '/usr/lib64/python3.6/__pycache__/os.cpython-36.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.6/__pycache__/stat.cpython-36.pyc matches /usr/lib64/python3.6/stat.py
# code object from '/usr/lib64/python3.6/__pycache__/stat.cpython-36.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab15a240>
# /usr/lib64/python3.6/__pycache__/posixpath.cpython-36.pyc matches /usr/lib64/python3.6/posixpath.py
# code object from '/usr/lib64/python3.6/__pycache__/posixpath.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/genericpath.cpython-36.pyc matches /usr/lib64/python3.6/genericpath.py
# code object from '/usr/lib64/python3.6/__pycache__/genericpath.cpython-36.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab15ec18>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab15a908>
# /usr/lib64/python3.6/__pycache__/_collections_abc.cpython-36.pyc matches /usr/lib64/python3.6/_collections_abc.py
# code object from '/usr/lib64/python3.6/__pycache__/_collections_abc.cpython-36.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1672b0>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab149b38>
# /usr/lib64/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc matches /usr/lib64/python3.6/_sitebuiltins.py
# code object from '/usr/lib64/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab149f28>
# /usr/lib64/python3.6/__pycache__/sysconfig.cpython-36.pyc matches /usr/lib64/python3.6/sysconfig.py
# code object from '/usr/lib64/python3.6/__pycache__/sysconfig.cpython-36.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9475710>
# /usr/lib64/python3.6/__pycache__/_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc matches /usr/lib64/python3.6/_sysconfigdata_m_linux_x86_64-linux-gnu.py
# code object from '/usr/lib64/python3.6/__pycache__/_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc'
import '_sysconfigdata_m_linux_x86_64-linux-gnu' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9484f98>
# /usr/lib64/python3.6/__pycache__/types.cpython-36.pyc matches /usr/lib64/python3.6/types.py
# code object from '/usr/lib64/python3.6/__pycache__/types.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/functools.cpython-36.pyc matches /usr/lib64/python3.6/functools.py
# code object from '/usr/lib64/python3.6/__pycache__/functools.cpython-36.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.6/collections/__pycache__/__init__.cpython-36.pyc matches /usr/lib64/python3.6/collections/__init__.py
# code object from '/usr/lib64/python3.6/collections/__pycache__/__init__.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/operator.cpython-36.pyc matches /usr/lib64/python3.6/operator.py
# code object from '/usr/lib64/python3.6/__pycache__/operator.cpython-36.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a944f048>
# /usr/lib64/python3.6/__pycache__/keyword.cpython-36.pyc matches /usr/lib64/python3.6/keyword.py
# code object from '/usr/lib64/python3.6/__pycache__/keyword.cpython-36.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a94592b0>
# /usr/lib64/python3.6/__pycache__/heapq.cpython-36.pyc matches /usr/lib64/python3.6/heapq.py
# code object from '/usr/lib64/python3.6/__pycache__/heapq.cpython-36.pyc'
# extension module '_heapq' loaded from '/usr/lib64/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so'
# extension module '_heapq' executed from '/usr/lib64/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f75a9459fd0>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9459ac8>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.6/__pycache__/reprlib.cpython-36.pyc matches /usr/lib64/python3.6/reprlib.py
# code object from '/usr/lib64/python3.6/__pycache__/reprlib.cpython-36.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9453780>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a942c710>
# /usr/lib64/python3.6/__pycache__/weakref.cpython-36.pyc matches /usr/lib64/python3.6/weakref.py
# code object from '/usr/lib64/python3.6/__pycache__/weakref.cpython-36.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a942cb00>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9422f60>
# /usr/lib64/python3.6/collections/__pycache__/abc.cpython-36.pyc matches /usr/lib64/python3.6/collections/abc.py
# code object from '/usr/lib64/python3.6/collections/__pycache__/abc.cpython-36.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a949ecf8>
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a94222b0>
# /usr/lib64/python3.6/importlib/__pycache__/__init__.cpython-36.pyc matches /usr/lib64/python3.6/importlib/__init__.py
# code object from '/usr/lib64/python3.6/importlib/__pycache__/__init__.cpython-36.pyc'
# /usr/lib64/python3.6/__pycache__/warnings.cpython-36.pyc matches /usr/lib64/python3.6/warnings.py
# code object from '/usr/lib64/python3.6/__pycache__/warnings.cpython-36.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9424048>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9422400>
# /usr/lib64/python3.6/importlib/__pycache__/util.cpython-36.pyc matches /usr/lib64/python3.6/importlib/util.py
# code object from '/usr/lib64/python3.6/importlib/__pycache__/util.cpython-36.pyc'
# /usr/lib64/python3.6/importlib/__pycache__/abc.cpython-36.pyc matches /usr/lib64/python3.6/importlib/abc.py
# code object from '/usr/lib64/python3.6/importlib/__pycache__/abc.cpython-36.pyc'
# /usr/lib64/python3.6/importlib/__pycache__/machinery.cpython-36.pyc matches /usr/lib64/python3.6/importlib/machinery.py
# code object from '/usr/lib64/python3.6/importlib/__pycache__/machinery.cpython-36.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9410400>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9419dd8>
# /usr/lib64/python3.6/__pycache__/contextlib.cpython-36.pyc matches /usr/lib64/python3.6/contextlib.py
# code object from '/usr/lib64/python3.6/__pycache__/contextlib.cpython-36.pyc'
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9410ef0>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75a9419780>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7f75ab1c3828>
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing builtins
# cleanup[2] removing sys
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing _imp
# cleanup[2] removing _warnings
# cleanup[2] removing _thread
# cleanup[2] removing _weakref
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing posix
# cleanup[2] removing zipimport
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing codecs
# cleanup[2] removing _codecs
# cleanup[2] removing encodings.aliases
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing _signal
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing io
# destroy io
# cleanup[2] removing abc
# cleanup[2] removing _weakrefset
# destroy _weakrefset
# cleanup[2] removing _bootlocale
# destroy _bootlocale
# cleanup[2] removing _locale
# cleanup[2] removing site
# destroy site
# cleanup[2] removing os
# cleanup[2] removing errno
# cleanup[2] removing stat
# cleanup[2] removing _stat
# cleanup[2] removing posixpath
# cleanup[2] removing genericpath
# cleanup[2] removing os.path
# cleanup[2] removing _collections_abc
# cleanup[2] removing _sitebuiltins
# cleanup[2] removing sysconfig
# destroy sysconfig
# cleanup[2] removing _sysconfigdata_m_linux_x86_64-linux-gnu
# destroy _sysconfigdata_m_linux_x86_64-linux-gnu
# cleanup[2] removing types
# cleanup[2] removing functools
# cleanup[2] removing _functools
# cleanup[2] removing collections
# cleanup[2] removing operator
# destroy operator
# cleanup[2] removing _operator
# cleanup[2] removing keyword
# destroy keyword
# cleanup[2] removing heapq
# cleanup[2] removing _heapq
# cleanup[2] removing itertools
# cleanup[2] removing reprlib
# destroy reprlib
# cleanup[2] removing _collections
# cleanup[2] removing weakref
# destroy weakref
# cleanup[2] removing collections.abc
# cleanup[2] removing importlib
# destroy importlib
# cleanup[2] removing importlib._bootstrap
# cleanup[2] removing importlib._bootstrap_external
# cleanup[2] removing warnings
# cleanup[2] removing importlib.util
# cleanup[2] removing importlib.abc
# cleanup[2] removing importlib.machinery
# cleanup[2] removing contextlib
# destroy contextlib
# cleanup[2] removing bkr
# destroy bkr
# destroy zipimport
# destroy _signal
# destroy _locale
# destroy _sitebuiltins
# destroy errno
# destroy posixpath
# destroy _stat
# destroy genericpath
# destroy stat
# destroy os
# destroy _functools
# destroy heapq
# destroy collections.abc
# destroy _operator
# destroy _heapq
# destroy _collections
# destroy collections
# destroy itertools
# destroy importlib.util
# destroy importlib.abc
# destroy functools
# destroy types
# destroy warnings
# destroy importlib.machinery
# destroy abc
# destroy _collections_abc
# cleanup[3] wiping _frozen_importlib
# destroy _frozen_importlib_external
# cleanup[3] wiping _imp
# cleanup[3] wiping _warnings
# cleanup[3] wiping _thread
# cleanup[3] wiping _weakref
# cleanup[3] wiping _io
# cleanup[3] wiping marshal
# cleanup[3] wiping posix
# cleanup[3] wiping codecs
# cleanup[3] wiping _codecs
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping importlib._bootstrap
# cleanup[3] wiping sys
# cleanup[3] wiping builtins

Comment 1 Miro Hrončok 2020-03-17 21:02:35 UTC
Also on Fedora 32:

== CPython 3.8.2 (default, Feb 28 2020, 00:00:00) [GCC 10.0.1 20200216 (Red Hat 10.0.1-0.8)]
== Linux-5.6.0-0.rc4.git0.1.fc32.x86_64-x86_64-with-glibc2.2.5 little-endian
== cwd: /tmp/test_python_624537
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 1.66 Run tests sequentially
0:00:00 load avg: 1.66 [1/1] test_site
test__getuserbase (test.test_site.HelperFunctionsTests) ... ok
test_addpackage (test.test_site.HelperFunctionsTests) ... ok
test_addpackage_import_bad_exec (test.test_site.HelperFunctionsTests) ... ok
test_addpackage_import_bad_pth_file (test.test_site.HelperFunctionsTests) ... ok
test_addpackage_import_bad_syntax (test.test_site.HelperFunctionsTests) ... ok
test_addsitedir (test.test_site.HelperFunctionsTests) ... ok
test_get_path (test.test_site.HelperFunctionsTests) ... ok
test_getsitepackages (test.test_site.HelperFunctionsTests) ... ok
test_getuserbase (test.test_site.HelperFunctionsTests) ... ok
test_getusersitepackages (test.test_site.HelperFunctionsTests) ... ok
test_init_pathinfo (test.test_site.HelperFunctionsTests) ... ok
test_makepath (test.test_site.HelperFunctionsTests) ... ok
test_no_home_directory (test.test_site.HelperFunctionsTests) ... ok
test_s_option (test.test_site.HelperFunctionsTests) ... ok
test_abs_paths (test.test_site.ImportSideEffectTests) ... ok
test_abs_paths_cached_None (test.test_site.ImportSideEffectTests)
Test for __cached__ is None. ... ok
test_add_build_dir (test.test_site.ImportSideEffectTests) ... skipped 'test not implemented'
test_aliasing_mbcs (test.test_site.ImportSideEffectTests) ... ok
test_license_exists_at_url (test.test_site.ImportSideEffectTests) ... skipped "resource 'network' is not enabled"
test_no_duplicate_paths (test.test_site.ImportSideEffectTests) ... ok
test_setting_copyright (test.test_site.ImportSideEffectTests) ... ok
test_setting_help (test.test_site.ImportSideEffectTests) ... ok
test_setting_quit (test.test_site.ImportSideEffectTests) ... ok
test_sitecustomize_executed (test.test_site.ImportSideEffectTests) ... ok
test_startup_imports (test.test_site.StartupImportTests) ... FAIL
test_startup_interactivehook (test.test_site.StartupImportTests) ... ok
test_startup_interactivehook_isolated (test.test_site.StartupImportTests) ... ok
test_startup_interactivehook_isolated_explicit (test.test_site.StartupImportTests) ... ok
test_underpth_file (test.test_site._pthFileTests) ... skipped 'only supported on Windows'
test_underpth_nosite_file (test.test_site._pthFileTests) ... skipped 'only supported on Windows'

======================================================================
FAIL: test_startup_imports (test.test_site.StartupImportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.8/test/test_site.py", line 542, in test_startup_imports
    self.assertFalse(modules.intersection(collection_mods), stderr)
AssertionError: {'reprlib', 'functools', 'types', 'collections', 'heapq', 'keyword', 'operator'} is not false : import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# /usr/lib64/python3.8/encodings/__pycache__/__init__.cpython-38.pyc matches /usr/lib64/python3.8/encodings/__init__.py
# code object from '/usr/lib64/python3.8/encodings/__pycache__/__init__.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/codecs.cpython-38.pyc matches /usr/lib64/python3.8/codecs.py
# code object from '/usr/lib64/python3.8/__pycache__/codecs.cpython-38.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5493d880>
# /usr/lib64/python3.8/encodings/__pycache__/aliases.cpython-38.pyc matches /usr/lib64/python3.8/encodings/aliases.py
# code object from '/usr/lib64/python3.8/encodings/__pycache__/aliases.cpython-38.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548d8e50>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5493d670>
# /usr/lib64/python3.8/encodings/__pycache__/utf_8.cpython-38.pyc matches /usr/lib64/python3.8/encodings/utf_8.py
# code object from '/usr/lib64/python3.8/encodings/__pycache__/utf_8.cpython-38.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5493dac0>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.8/encodings/__pycache__/latin_1.cpython-38.pyc matches /usr/lib64/python3.8/encodings/latin_1.py
# code object from '/usr/lib64/python3.8/encodings/__pycache__/latin_1.cpython-38.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548d8f40>
# /usr/lib64/python3.8/__pycache__/io.cpython-38.pyc matches /usr/lib64/python3.8/io.py
# code object from '/usr/lib64/python3.8/__pycache__/io.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/abc.cpython-38.pyc matches /usr/lib64/python3.8/abc.py
# code object from '/usr/lib64/python3.8/__pycache__/abc.cpython-38.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548f0430>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548f0160>
Python 3.8.2 (default, Feb 28 2020, 00:00:00) 
[GCC 10.0.1 20200216 (Red Hat 10.0.1-0.8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
# /usr/lib64/python3.8/__pycache__/site.cpython-38.pyc matches /usr/lib64/python3.8/site.py
# code object from '/usr/lib64/python3.8/__pycache__/site.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/os.cpython-38.pyc matches /usr/lib64/python3.8/os.py
# code object from '/usr/lib64/python3.8/__pycache__/os.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/stat.cpython-38.pyc matches /usr/lib64/python3.8/stat.py
# code object from '/usr/lib64/python3.8/__pycache__/stat.cpython-38.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5488ed30>
# /usr/lib64/python3.8/__pycache__/_collections_abc.cpython-38.pyc matches /usr/lib64/python3.8/_collections_abc.py
# code object from '/usr/lib64/python3.8/__pycache__/_collections_abc.cpython-38.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5488edc0>
# /usr/lib64/python3.8/__pycache__/posixpath.cpython-38.pyc matches /usr/lib64/python3.8/posixpath.py
# code object from '/usr/lib64/python3.8/__pycache__/posixpath.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/genericpath.cpython-38.pyc matches /usr/lib64/python3.8/genericpath.py
# code object from '/usr/lib64/python3.8/__pycache__/genericpath.cpython-38.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548c4700>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5488ee50>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d549014c0>
# /usr/lib64/python3.8/__pycache__/_sitebuiltins.cpython-38.pyc matches /usr/lib64/python3.8/_sitebuiltins.py
# code object from '/usr/lib64/python3.8/__pycache__/_sitebuiltins.cpython-38.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54901d60>
# /usr/lib64/python3.8/__pycache__/_bootlocale.cpython-38.pyc matches /usr/lib64/python3.8/_bootlocale.py
# code object from '/usr/lib64/python3.8/__pycache__/_bootlocale.cpython-38.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548c4b50>
# /usr/lib64/python3.8/__pycache__/types.cpython-38.pyc matches /usr/lib64/python3.8/types.py
# code object from '/usr/lib64/python3.8/__pycache__/types.cpython-38.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548c4df0>
# /usr/lib64/python3.8/importlib/__pycache__/__init__.cpython-38.pyc matches /usr/lib64/python3.8/importlib/__init__.py
# code object from '/usr/lib64/python3.8/importlib/__pycache__/__init__.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/warnings.cpython-38.pyc matches /usr/lib64/python3.8/warnings.py
# code object from '/usr/lib64/python3.8/__pycache__/warnings.cpython-38.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548429d0>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54842640>
# /usr/lib64/python3.8/importlib/__pycache__/util.cpython-38.pyc matches /usr/lib64/python3.8/importlib/util.py
# code object from '/usr/lib64/python3.8/importlib/__pycache__/util.cpython-38.pyc'
# /usr/lib64/python3.8/importlib/__pycache__/abc.cpython-38.pyc matches /usr/lib64/python3.8/importlib/abc.py
# code object from '/usr/lib64/python3.8/importlib/__pycache__/abc.cpython-38.pyc'
# /usr/lib64/python3.8/importlib/__pycache__/machinery.cpython-38.pyc matches /usr/lib64/python3.8/importlib/machinery.py
# code object from '/usr/lib64/python3.8/importlib/__pycache__/machinery.cpython-38.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54855250>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5484c550>
# /usr/lib64/python3.8/__pycache__/contextlib.cpython-38.pyc matches /usr/lib64/python3.8/contextlib.py
# code object from '/usr/lib64/python3.8/__pycache__/contextlib.cpython-38.pyc'
# /usr/lib64/python3.8/collections/__pycache__/__init__.cpython-38.pyc matches /usr/lib64/python3.8/collections/__init__.py
# code object from '/usr/lib64/python3.8/collections/__pycache__/__init__.cpython-38.pyc'
# /usr/lib64/python3.8/__pycache__/operator.cpython-38.pyc matches /usr/lib64/python3.8/operator.py
# code object from '/usr/lib64/python3.8/__pycache__/operator.cpython-38.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54801760>
# /usr/lib64/python3.8/__pycache__/keyword.cpython-38.pyc matches /usr/lib64/python3.8/keyword.py
# code object from '/usr/lib64/python3.8/__pycache__/keyword.cpython-38.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54801850>
# /usr/lib64/python3.8/__pycache__/heapq.cpython-38.pyc matches /usr/lib64/python3.8/heapq.py
# code object from '/usr/lib64/python3.8/__pycache__/heapq.cpython-38.pyc'
# extension module '_heapq' loaded from '/usr/lib64/python3.8/lib-dynload/_heapq.cpython-38-x86_64-linux-gnu.so'
# extension module '_heapq' executed from '/usr/lib64/python3.8/lib-dynload/_heapq.cpython-38-x86_64-linux-gnu.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f4d548061c0>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548019d0>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib64/python3.8/__pycache__/reprlib.cpython-38.pyc matches /usr/lib64/python3.8/reprlib.py
# code object from '/usr/lib64/python3.8/__pycache__/reprlib.cpython-38.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54801d60>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54862940>
# /usr/lib64/python3.8/__pycache__/functools.cpython-38.pyc matches /usr/lib64/python3.8/functools.py
# code object from '/usr/lib64/python3.8/__pycache__/functools.cpython-38.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54862af0>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d5484cc10>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54842820>
# possible namespace for /usr/lib64/python3.8/site-packages/mpl_toolkits
# possible namespace for /usr/lib64/python3.8/site-packages/zope
# possible namespace for /usr/lib/python3.8/site-packages/paste
# /usr/lib/python3.8/site-packages/__pycache__/abrt_exception_handler3.cpython-38.pyc matches /usr/lib/python3.8/site-packages/abrt_exception_handler3.py
# code object from '/usr/lib/python3.8/site-packages/__pycache__/abrt_exception_handler3.cpython-38.pyc'
import 'abrt_exception_handler3' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d54862ca0>
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /usr/lib/python3.8/site-packages/straight
# possible namespace for /usr/lib/python3.8/site-packages/zope
# destroy zope
# possible namespace for /usr/lib64/python3.8/site-packages/zope
# possible namespace for /usr/lib/python3.8/site-packages/zope
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4d548f0d90>
# clear sys.audit hooks
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing sys
# cleanup[2] removing builtins
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing _imp
# cleanup[2] removing _warnings
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing posix
# cleanup[2] removing _thread
# cleanup[2] removing _weakref
# cleanup[2] removing time
# cleanup[2] removing zipimport
# destroy zipimport
# cleanup[2] removing _codecs
# cleanup[2] removing codecs
# cleanup[2] removing encodings.aliases
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing _signal
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing _abc
# cleanup[2] removing abc
# cleanup[2] removing io
# cleanup[2] removing _stat
# cleanup[2] removing stat
# cleanup[2] removing _collections_abc
# cleanup[2] removing genericpath
# cleanup[2] removing posixpath
# cleanup[2] removing os.path
# cleanup[2] removing os
# cleanup[2] removing _sitebuiltins
# cleanup[2] removing _locale
# cleanup[2] removing _bootlocale
# destroy _bootlocale
# cleanup[2] removing types
# cleanup[2] removing importlib._bootstrap
# cleanup[2] removing importlib._bootstrap_external
# cleanup[2] removing warnings
# cleanup[2] removing importlib
# destroy importlib
# cleanup[2] removing importlib.machinery
# cleanup[2] removing importlib.abc
# cleanup[2] removing _operator
# cleanup[2] removing operator
# destroy operator
# cleanup[2] removing keyword
# destroy keyword
# cleanup[2] removing _heapq
# cleanup[2] removing heapq
# cleanup[2] removing itertools
# cleanup[2] removing reprlib
# destroy reprlib
# cleanup[2] removing _collections
# cleanup[2] removing collections
# destroy collections
# cleanup[2] removing _functools
# cleanup[2] removing functools
# cleanup[2] removing contextlib
# destroy contextlib
# cleanup[2] removing importlib.util
# cleanup[2] removing mpl_toolkits
# destroy mpl_toolkits
# cleanup[2] removing zope
# destroy zope
# cleanup[2] removing paste
# destroy paste
# cleanup[2] removing abrt_exception_handler3
# destroy abrt_exception_handler3
# cleanup[2] removing sphinxcontrib
# destroy sphinxcontrib
# cleanup[2] removing straight
# destroy straight
# cleanup[2] removing site
# destroy site
# destroy time
# destroy _signal
# destroy _sitebuiltins
# destroy io
# destroy _locale
# destroy importlib.util
# destroy importlib.abc
# destroy functools
# destroy types
# destroy importlib.machinery
# destroy warnings
# destroy _collections_abc
# destroy heapq
# destroy _operator
# destroy _heapq
# destroy itertools
# destroy _collections
# destroy _functools
# cleanup[3] wiping importlib._bootstrap_external
# cleanup[3] wiping importlib._bootstrap
# destroy _frozen_importlib_external
# cleanup[3] wiping os
# destroy abc
# destroy posixpath
# cleanup[3] wiping genericpath
# cleanup[3] wiping stat
# cleanup[3] wiping _stat
# destroy _stat
# cleanup[3] wiping _abc
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping codecs
# cleanup[3] wiping _codecs
# cleanup[3] wiping _weakref
# destroy _weakref
# cleanup[3] wiping _thread
# destroy _thread
# cleanup[3] wiping posix
# destroy posix
# cleanup[3] wiping marshal
# destroy marshal
# cleanup[3] wiping _io
# destroy io
# cleanup[3] wiping _warnings
# destroy _warnings
# cleanup[3] wiping _imp
# destroy _imp
# cleanup[3] wiping _frozen_importlib
# cleanup[3] wiping sys
# cleanup[3] wiping builtins
# destroy _abc
# destroy os
# destroy stat
# destroy genericpath
# destroy _frozen_importlib


----------------------------------------------------------------------

Ran 30 tests in 0.206s

FAILED (failures=1, skipped=4)
test_site failed

== Tests result: FAILURE ==

1 test failed:
    test_site

Total duration: 243 ms
Tests result: FAILURE

Comment 2 Victor Stinner 2020-03-18 13:50:13 UTC
The problem is not the Python package, but that the test is affected by .pth files installed by other packages and these .pth files modify the list of modules imported at Python startup.

For example on a RHEL8 VM installed by 1minutetip, beaker-client is pre-installed and this package contains /usr/lib/python3.6/site-packages/beaker_client-27.2-py3.6-nspkg.pth. This file is always executed at Python startup even when python3 is run with python3 -I ("isolated" mode) and the .pth file imports multiple modules (sys, types, os, importlib.util, importlib.machinery, bkr).

Example:

# dnf install -y python3-test
# python3 -m test.test_site
(...)
FAILED (failures=1, skipped=3)

Removing beaker-client works around the issue:

# dnf remove -y beaker-client 
# python3 -m test.test_site
(...)
OK (skipped=3)

On RHEL8, you can search for .pth files with:

# find /usr/lib/python3.6 -name "*.pth"
# find /usr/lib64/python3.6 -name "*.pth"

Since there is no way to ignore installed .pth files, I see no obvious way to fix the test.

The workaround is to uninstall packages containing .pth files, or don't run tests when such .pth files are installed.

Comment 3 Victor Stinner 2020-03-18 15:00:43 UTC
I found a Python upstream issue: https://bugs.python.org/issue27807

I plan to propose a fix there.

Comment 4 Charalampos Stratakis 2020-03-19 11:14:36 UTC
Tested the PR downstream and the test is skipped with "skipped 'found 1 .pth files in: /usr/lib/python3.6/site-packages'"

Comment 5 Victor Stinner 2020-03-20 14:58:31 UTC
I fixed https://bugs.python.org/issue27807 : I pushed changes into 3.7, 3.8 and master branches of upstream Python.

Comment 11 errata-xmlrpc 2020-11-04 01:30:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: python3 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4433


Note You need to log in before you can comment on or make changes to this bug.