Hello
Python is loading the first file with .py extension as module when it is
requested by an import in the called script. Even an empty file is
loaded as module.
The feature or bad thing is that the current directory is in the python
path.
$ touch threading.py
$ python -m venv my_venv
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "/usr/lib/python3.10/venv/__init__.py", line 7, in <module>
import logging
File "/usr/lib/python3.10/logging/__init__.py", line 217, in <module>
_lock = threading.RLock()
AttributeError: module 'threading' has no attribute 'RLock'
Error in sys.excepthook:
BR,
Roland