Distributed self-replicating programs in Python
Go to file
David Wilson cf01c6b710 importer: avoid duplicate module load(!); closes #113.
Amazed this one managed to scrape through for so long. Calling
__import__ from within find_module() was causing the target module, in
this case cookielib, to be loaded *then overwritten* by a subsequent
duplicate load higher in the stack.

The result is that cookielib was loaded twice, and, per usual Python
import semantics, a reference to the partially initialized first
cookielib was installed in sys.modules while its code executed.

At the end of cookielib on 2.x, it imports _LWPCookieJar, which in turn
imports the partially built cookielib from sys.modules, then subclasses
the CookieJar from /that/ module.

Everything is wonderful. Then the call returns back up into the import
mechanism which restarts the entire process -- only this time,
_LWPCookieJar is /not/ reinitialized, so the copy in sys.modules is
still left with types pointing at the old module!

So the duplicate import creates a new CookieJar which is not the base
class of LWPCookieJar. Tada! 3 hours debugging.

This is probably a performance fix in disguise, didn't realize things
were so broken. It may also be a regression elsewhere. Urgently need to
finish the tests.
2018-03-19 21:58:32 +05:45
ansible_mitogen ansible: redirect logging into display 'framework'. closes #111 2018-03-19 21:58:32 +05:45
docs Pin Sphinx version 2018-03-19 21:58:32 +05:45
examples importer: avoid duplicate module load(!); closes #113. 2018-03-19 21:58:32 +05:45
mitogen importer: avoid duplicate module load(!); closes #113. 2018-03-19 21:58:32 +05:45
tests README: move testing bits into tests directory. 2018-03-19 21:58:32 +05:45
.gitignore Some gitignore extras 2018-03-19 21:58:29 +05:45
.lgtm.yml compat: ignore LGTM checks on third party 2018-03-19 21:58:31 +05:45
.travis.yml Remove overall build timeout from .travis.yml. 2018-03-19 21:58:28 +05:45
LICENSE Add license text everywhere. 2018-03-19 21:58:28 +05:45
README.md README: move testing bits into tests directory. 2018-03-19 21:58:32 +05:45
dev_requirements.txt Move django test script into permanent test 2018-03-19 21:58:28 +05:45
preamble_size.py docs: fix preamble_size.py after whitelist changes 2018-03-19 21:58:29 +05:45
setup.cfg Initial flake8 configuration. 2018-03-19 21:58:32 +05:45
setup.py issue #93: enable use_2to3 to see what happens 2018-03-19 21:58:31 +05:45
test.sh test.sh: make it work on OS X out of the box 2018-03-19 21:58:32 +05:45

README.md