Bugs item #3390456, was opened at 2011-08-12 19:39
Message generated for change (Settings changed) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3390456&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32
Group: None
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: adiroiban ()
Assigned to: Nobody/Anonymous (nobody)
Summary: pywintypes must be explicitly imported before win32api
Initial Comment:
Hi,
I just want to raise awareness of this bug that affects Twisted on Windows using a 'portable' Python installation.
http://twistedmatrix.com/trac/ticket/3868
it looks like the following import will fail
from win32api import OpenProcess
import pywintypes
while changing the import order fixed the problem.
from win32api import OpenProcess
import pywintypes
----
This only happend if I call python.exe from another working folder as the one hosting the python.exe file.
All DLLs are in the same folder as python.exe
I am thinking that win32api is only trying to load the dlls from the current working folder, not the one hosting the python.exe.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2011-08-13 10:54
Message:
I think we will find that the magic done in pywintypes.py to locate and
load the pywintypesxx.dll module is what fixes the problem in most cases -
without that import I expect it is that DLL which can't be located when
importing win32api. I'm not sure what a fix is though.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3390456&group_id=78018
|