On 5/13/2009 3:56 PM, Vinay Sajip wrote: > > > On May 13, 1:54 pm, Giovanni Bajo <[email protected]> wrote: >> They look like different issues to me. I'll have a look at reproducing >> either later today. > > I just did a test on Ubuntu Hardy/python2.5 - I turned debugging on in > iu.py and printed out sys.modules.keys in importHook. Here's what I > get: > > importHook(encodings, __main__, locals, None) > sys/modules.keys: ['copy_reg', '__main__', 'iu', '__builtin__', > 'encodings', 'encodings.encodings', 'archive', 'posixpath', 'errno', > 'encodings.codecs', 'imp', 'types', 'UserDict', '_struct', 'stat', > 'zipimport', 'warnings', 'encodings.types', '_codecs', > 'encodings.utf_8', 'sys', 'codecs', 'os.path', 'struct', '_types', > 'signal', 'linecache', 'posix', 'encodings.aliases', 'exceptions', > 'os', 'marshal'] > importernm __main__ > importHook trying encodings in None > sys.modules.get(encodings) -> <module 'encodings' from '/usr/lib/ > python2.5/encodings/__init__.pyc'> > importHook done with encodings __main__ None (case 2) > > So even on python2.5, we're picking up the encodings module from the > host system, not from the executable as we should be.
This looks like it can't be fixed. That import happens before *any* Python code is executed, within Py_Initialize(). I don't see *any* way to hook that import, unfortunately. It happens only under Linux because in that system the Python binary contains a hardcoded prefix (like /usr/lib) that is always tried (see getpath.c in Python's source code). The Win32 getpath module instead doesn't have any hardcoded path. I'm not really convinced this is a problem either -- I need further investigation. -- Giovanni Bajo Develer S.r.l. http://www.develer.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/PyInstaller?hl=en -~----------~----~----~----~------~----~------~--~---
