Alex Willmer
Alex Willmer
I've begun trying variations of your tests in https://github.com/mitogen-hq/mitogen/pull/1392, I'm finishing for the day now but tomorrow or later this week would you like to do a call (e.g. Jitsi,...
> Can you please push your commit [733f4bc](https://github.com/mitogen-hq/mitogen/commit/733f4bca81d14da8af70cef61da74f3cab813503) as it makes sense anyway. When it's pushed I can add some comments to the first stage. Done in #1393
Thanks for all this. When you're ready I'll do a full review.
@zostrich 1. What version fo Mitogen are you using? 2. What version of Ansible? 3. What version(s) of Python on the controller & target(s)?
Python 3.x ships [_compat_pickle](https://github.com/python/cpython/blob/master/Lib/_compat_pickle.py), which maps many (all?) renamed modules. The file comments say it's a copy of [lib2to3.fixes.fix_imports](https://github.com/python/cpython/blob/master/Lib/lib2to3/fixes/fix_imports.py). I haven't checked how much the two have diverged.
```python >>> import _compat_pickle >>> python2_modules = sorted(_compat_pickle.IMPORT_MAPPING.keys()) >>> '|'.join(python2_modules) 'BaseHTTPServer|CGIHTTPServer|ConfigParser|Cookie|Dialog|DocXMLRPCServer|FileDialog|HTMLParser|Queue|ScrolledText|SimpleDialog|SimpleHTTPServer|SimpleXMLRPCServer|SocketServer|StringIO|Tix|Tkconstants|Tkdnd|Tkinter|UserDict|UserList|UserString|__builtin__|_abcoll|_elementtree|_winreg|anydbm|cPickle|cStringIO|commands|cookielib|copy_reg|dbhash|dbm|dumbdbm|dummy_thread|gdbm|htmlentitydefs|httplib|markupbase|repr|robotparser|test.test_support|thread|tkColorChooser|tkCommonDialog|tkFileDialog|tkFont|tkMessageBox|tkSimpleDialog|ttk|urllib2|urlparse|whichdb|xmlrpclib' ``` Running that through [regex-opt](https://bisqwit.iki.fi/source/regexopt.html) gives ``` __builtin__|dbhash|ttk|urllib2|(?:rep|(?:Tkint|(?:Socket|(?:CGI|(?:Bas|Simpl)e)HTTP|(?:Doc|Simple)XMLRPC)Serv|(?:tkColorChoo|(?:robotp|(?:Config|HTML)P)ar)s)e)r|(?:Cooki|Queu|cPickl|(?:markupba|urlpar)s)e|(?:UserStrin|(?:tkCommon|(?:tk)?(?:Fi|Simp)le)?Dialo|(?:_win|copy_)re)g|(?:ScrolledTex|User(?:Dic|Lis)|t(?:est.test_suppor|kFon))t|c?StringIO|(?:Ti|tkMessageBo)x|(?:Tkconstant|command|htmlentitydef)s|(?:Tkdn|(?:dummy_)?threa)d|(?:any|dumb|g)?dbm|(?:whichd|(?:cookie|http|xmlrpc)li)b|_(?:abcoll|elementtree) ```
Alternatively https://github.com/jackmaney/python-stdlib-list has lists for Python 2.6-2.7 and 3.2-3.6
What caching could Mitogen (optionally) do? E.g. - Controller - cache minified modules - Parents - cache in-transit modules - Targets - cache received modules Considerations - Cache invalidation -...
Using bytecode may be quicker than ast, if the bytecode can be read from a cached .pyc, rather than parsed each time from .py
> issue #19: second attempt at import scanner > > This version is based on the modulefinder standard library module, pruned back just to handle modules we know have been...