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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 11 Jul 2002 00:04:18 -0700


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

Category: Windows
Group: Platform-specific
>Status: Pending
>Resolution: Wont Fix
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: Mark Hammond (mhammond)
Date: 2002-07-11 17:04

Message:
Logged In: YES 
user_id=14198

Really dont know how to fix this and it is not clear the
patch is acceptable just for pythoncom.  Not clear that
anyone even really cares about ihooks as no one else has
complained about this but i am willing to look at it again
if anyone even notices :)

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

Comment By: Nobody/Anonymous (nobody)
Date: 2002-06-13 21:51

Message:
Logged In: NO 

yes i found that your new modele is the shit


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

Comment By: Jeremy Hylton (jhylton)
Date: 2002-03-02 09: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-13 02:13

Message:
Logged In: NO 

i try it first,ok


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

Comment By: Nobody/Anonymous (nobody)
Date: 2001-11-16 10:19

Message:
Logged In: NO 

¾È³çÇϼ¼¿ä

ÀÌÁ¦ºÎÅÍ Á¦ ¼Ò°³¸¦ ÇÏ°Ú½À´Ï´Ù

ÀúÀÇ À̸§Àº ¹ÚÇýÁØ ÀÌ°í¿ä

³ªÀÌ´Â 13»ìÀÌ¿¡¿ä

±×¸®°í °¡Á·Àº ¸ðµÎ 4¸í

¾ö¸¶ ¾Æºü ´©³ª ³ª

Á¦°¡ »ç´Â °÷Àº ºÐ´ç±¸ ¾ßžµ¿ ¸ÅÈ­¸¶À» 105-1006

Á¦ ÀüÈ­¹øÈ£´Â¿© 031-704-9838

Àú´Â Çѱ¹ÀÎ ÀÔ´Ï´Ù.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2001-09-20 03:23

Message:
Logged In: NO 

ruoy retupmoc si daed

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

Comment By: Grzegorz Makarewicz (mpmak)
Date: 2001-03-02 23: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 17: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 16: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: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=210637&group_id=5470