The following code:
from typeguard.importhook import install_import_hook
install_import_hook('')
import pkg_resources
produces the following output:
$ python3 Test.py
Traceback (most recent call last):
File "Test.py", line 5, in <module>
import pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 77, in <module>
__import__('pkg_resources.extern.packaging.requirements')
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/lib/python3/dist-packages/pkg_resources/extern/__init__.py", line 43, in load_module
__import__(extant)
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 5353, in <module>
class pyparsing_common:
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/__init__.py", line 721, in typechecked
if callable(attr) and attr.__qualname__.startswith(prefix):
AttributeError: 'Combine' object has no attribute '__qualname__'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/apport/report.py", line 28, in <module>
import problem_report
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/problem_report.py", line 16, in <module>
from email.mime.multipart import MIMEMultipart
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3.6/email/mime/multipart.py", line 9, in <module>
from email.mime.base import MIMEBase
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3.6/email/mime/base.py", line 9, in <module>
import email.policy
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3.6/email/policy.py", line 26, in <module>
class EmailPolicy(Policy):
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/__init__.py", line 721, in typechecked
if callable(attr) and attr.__qualname__.startswith(prefix):
AttributeError: 'HeaderRegistry' object has no attribute '__qualname__'
Original exception was:
Traceback (most recent call last):
File "Test.py", line 5, in <module>
import pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 77, in <module>
__import__('pkg_resources.extern.packaging.requirements')
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/lib/python3/dist-packages/pkg_resources/extern/__init__.py", line 43, in load_module
__import__(extant)
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/importhook.py", line 82, in exec_module
return super().exec_module(module)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 5353, in <module>
class pyparsing_common:
File "/usr/local/lib/python3.6/dist-packages/typeguard-2.6.0.post5-py3.6.egg/typeguard/__init__.py", line 721, in typechecked
if callable(attr) and attr.__qualname__.startswith(prefix):
AttributeError: 'Combine' object has no attribute '__qualname__'
bug