You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/mitogen
Alex Willmer d2ca8a9423 master.ParentEnumerationMethod: Require matching pkg.__name__
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>

When the requested module (e.g. ansible.module_utils.distro)
- is provided by another module *e.g. distro)
- that itself was a package (e.g. distro 1.7.0)

At runtime
- ansible/module_utils/distro/__init__.py executes
- if https://pypi.org/project/distro/ is present, it's loaded as
ansible.module_utils.distro
- otherwise ansible/module_utils/distro/_distro.py is loaded

ParentEnumerationMethod would wrongly use whatever was in
sys.modules['ansible.module_utils.distro]. Instead we should ascend to
the first parent that has fullname == sys.modules[fullname].__name__.
Then descend to the appropriate .py file on disk.

This bug didn't show up before because until distro 1.7.0 (Feb 2022) the
top-level distro module was a module (distro.py) not a package
(distro/__init__.py)

fixes #906
2 years ago
..
compat compat: fix Py2.4 SyntaxError 5 years ago
__init__.py Start v0.3.3 development 2 years ago
buildah.py [stream-refactor] port mitogen.buildah, added to master since work began 5 years ago
core.py Add notes on imports and importlib 2 years ago
debug.py [stream-refactor] fix flake8 errors 5 years ago
doas.py remove unused imports flagged by lgtm 5 years ago
docker.py Refactor Stream, introduce quasi-asynchronous connect, much more 5 years ago
fakessh.py [stream-refactor] rename Process attrs, fix up more create_child_test 5 years ago
fork.py Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 5 years ago
jail.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
kubectl.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
lxc.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
lxd.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
master.py master.ParentEnumerationMethod: Require matching pkg.__name__ 2 years ago
minify.py Normalize docstring formatting 5 years ago
os_fork.py os_fork: do not attempt to cork the active thread. 5 years ago
parent.py mitogen.parent: Detect and avoid Python2.7 wrapper on macOS 11 & 12 2 years ago
podman.py Add podman connection support 3 years ago
profiler.py Fix stdlib typos that would cause NameError or AttributeError exceptions 3 years ago
select.py Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 5 years ago
service.py see if sys.path is being loaded properly on azure 4 years ago
setns.py Refactor Stream, introduce quasi-asynchronous connect, much more 5 years ago
ssh.py ssh: Match newer ssh host key prompt that accepts the fingerprint 4 years ago
su.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
sudo.py reverted autolinted code 4 years ago
unix.py core: MitogenProtocol.is_privileged was not set in children 5 years ago
utils.py Stop using mitogen root logger in more modules, remove unused loggers 5 years ago