Ticket #580 (closed defect: fixed)
__path__ value is cached so __init__ files cannot change their own __path__ value
| Reported by: | ikelos | Owned by: | giovannibajo |
|---|---|---|---|
| Priority: | normal | Milestone: | PyInstaller 2.1 |
| Component: | Loader | Version: | develop |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hi there,
In the course of developing volatility, we make use of a plugin mechanism [1] that sets the volatility.plugins.path value to a list of directories from which plugins can be loaded. These are later manually traversed and all imports made using import [2].
When packaging up the most recent version using both 1.5.1 and the dev branch we found that changes made to the path variable were not being seen, and delving within the code this appeared to be because the iu.ImportLoader? caches the path variable as part of the ImportDirector? and therefore after the first import this never changed.
I've attached a patch below that appears to remedy the problem, but the internals of the loader are quite complex, and I had to use im_self to recover the object that needed updating. As such any help/advice on this patch would be much appreciated...
[1] https://code.google.com/p/volatility/source/browse/trunk/volatility/plugins/__init__.py [2] https://code.google.com/p/volatility/source/browse/trunk/volatility/registry.py#118
Attachments
Change History
Changed 10 months ago by ikelos
- Attachment pyinstaller-path.patch added

pyinstaller iu.ImportManager? patch to support dynamic path values