[Python-projects] ImportError from proc module in logilab-common on Windows

Sylvain Thénault sylvain.thenault at logilab.fr
Mon Feb 9 22:01:50 CET 2009


Le Wednesday 04 February 2009 13:12:06 Sini Mäkelä, vous avez écrit :

> There are also some other imports in following lines that won't work
> on Windows with Python 2.5.2.
>
> line 116: from os import killpg, getpid, setpgrp
> killpg & setpgrp don't exist
>
> line 120: from resource import getrlimit, setrlimit, RLIMIT_CPU, RLIMIT_AS
> resource doesn't exist

fine. For pylint sake, apply the following patch in shellutils.py:

@@ -20,7 +20,14 @@
 from os.path import exists, isdir, islink, basename, join, walk
 
 from logilab.common import STD_BLACKLIST
-from logilab.common.proc import ProcInfo, NoSuchProcess
+try:
+    from logilab.common.proc import ProcInfo, NoSuchProcess
+except ImportError:
+    # windows platform
+    class NoSuchProcess(Exception): pass
+    
+    def ProcInfo(pid):
+        raise NoSuchProcess()


that should be enough, lgc.proc is expected to be non windows compatible.

> By the way, what is proper way to report bugs? I couldn't find this
> information on the web page. I would have added this as a comment to
> the bug report, but couldn't figure out how to do that either.
> Anonymous comment wasn't accepted... I think.

humm, you should have been able to add comments on the ticket... Anyway 
reporting bug on this list is fine.
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science


More information about the Python-Projects mailing list