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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 15 Nov 2001 15:19:35 -0800


Bugs item #210637, was opened at 2000-07-31 14: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: Nobody/Anonymous (nobody)
Date: 2001-11-15 15:19

Message:
Logged In: NO 

¾È³çÇϼ¼¿ä

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

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

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

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

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

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

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

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

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

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

Message:
Logged In: NO 

ruoy retupmoc si daed

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

Comment By: Grzegorz Makarewicz (mpmak)
Date: 2001-03-02 04: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-30 23: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-13 23: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