[Python-bugs-list] [ python-Bugs-210637 ] ihooks on windows and pythoncom (PR#294)

noreply@sourceforge.net noreply@sourceforge.net
Fri, 01 Mar 2002 14:29:47 -0800


Bugs item #210637, was opened at 2000-07-31 21:09
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=210637&group_id=5470

Category: Windows
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Mark Hammond (mhammond)
Summary: ihooks on windows and pythoncom (PR#294)

Initial Comment:
Jitterbug-Id: 294
Submitted-By: mak@mikroplan.com.pl
Date: Thu, 13 Apr 2000 04:09:35 -0400 (EDT)
Version: cvs
OS: windows


Hi,

Python module ihooks is not so compatible with builtin imp while importing
modules whose name is stored in registry eg. pythoncom/pywintypes.

import ihooks
ihooks.install()
import pythoncom

This code will fail inside pythonwin ide too !




====================================================================
Audit trail:
Tue Jul 11 08:29:17 2000	guido	moved from incoming to open

----------------------------------------------------------------------

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-03-01 22:29

Message:
Logged In: YES 
user_id=31392

Mark,

Any interest in looking at this bug?  It holds the record 
for the oldest Python bug at SF.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-02-12 15:13

Message:
Logged In: NO 

i try it first,ok


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-11-15 23:19

Message:
Logged In: NO 

안녕하세요

이제부터 제 소개를 하겠습니다

저의 이름은 박혜준 이고요

나이는 13살이에요

그리고 가족은 모두 4명

엄마 아빠 누나 나

제가 사는 곳은 분당구 야탑동 매화마을 105-1006

제 전화번호는여 031-704-9838

저는 한국인 입니다.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-09-19 17:23

Message:
Logged In: NO 

ruoy retupmoc si daed

----------------------------------------------------------------------

Comment By: Grzegorz Makarewicz (mpmak)
Date: 2001-03-02 12:27

Message:
Logged In: YES 
user_id=141704

BasicModuleLoader.find_module_in_dir is searching for main 
modules only in frozen and builtin. The imp searches the 
registry, too.

ModuleLoader.find_module_in_dir should call the functions 
from the inherited object.

so this patch should help:
--- V:\py21\Lib\ihooks.py	Mon Feb 12 08:55:46 2001
+++ ihooks.py	Sun Feb 18 04:39:39 2001
@@ -122,8 +122,13 @@
 
     def find_module_in_dir(self, name, dir):
         if dir is None:
-            return self.find_builtin_module(name)
-        else:
+            result = self.find_builtin_module(name)
+            if result is not None:
+                return result
+            try:
+                return imp.find_module(name, None)
+            except:
+                return None
             try:
                 return imp.find_module(name, [dir])
             except ImportError:
@@ -237,7 +242,7 @@
 
     def find_module_in_dir(self, name, dir, 
allow_packages=1):
         if dir is None:
-            return self.find_builtin_module(name)
+            return BasicModuleLoader.find_module_in_dir
(self,name,dir)
         if allow_packages:
             fullname = self.hooks.path_join(dir, name)
             if self.hooks.path_isdir(fullname):


----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2000-08-31 06:23

Message:
Leaving open, but moving down the priority and resolution lists.  A patch would help bump it back up :-)

----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2000-08-14 06:42

Message:
This needs a resolution.  The "registered module" code in the code also needs to support HKEY_CURRENT_USER along with the HKEY_LOCAL_MACHINE it does now.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=210637&group_id=5470