Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #580 (closed defect: fixed)

Opened 10 months ago

Last modified 3 months ago

__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

pyinstaller-path.patch (587 bytes) - added by ikelos 10 months ago.
pyinstaller iu.ImportManager? patch to support dynamic path values

Change History

Changed 10 months ago by ikelos

pyinstaller iu.ImportManager? patch to support dynamic path values

comment:1 Changed 10 months ago by matysek

  • Milestone set to PyInstaller 2.1

This need more investigation. Adding to 2.1 milestone.

comment:2 Changed 3 months ago by matysek

  • Status changed from new to closed
  • Resolution set to fixed

The import mechanism was completely rewritten to use PEP-302 import hooks so I think this should not be an issue anymore with latest development branch.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.