Re: latest trunk revision breaks twistd utility on MSW

Werner Thie <[email protected]> Tue, 22 May 2007 19:29:10 +0200
Newsgroups gmane.comp.python.quotient.dev
Message-ID <[email protected]>
Sorry for being so late, but the easy fix was to revert to some older 
version of testutil.py which does not include Popen3.

Traceback: see attachment

The problem lies in the inclusion of Popen3, which does not exist at all 
under MSW. Use of Popen3 is in function run (line 394), which spawns a 
process running the Java Interpreter and catching more of its status 
with the Popen3 func vs the formerly used popen2.

Tests are usually not run on MSW so I would propose a simple wrapping of 
the the imports

if sys.platform != "win32":
   from popen2 import Popen3
   from os import WEXITSTATUS

The downside is a nonfunctional testutil.py for MSW, but process support 
is/was always a oddity on MSW.

HTH, Werner

[email protected] wrote:
> Nevow isn't a general twisted topic, so I'm not re-cross-posting.
> 
> 
> On 3 May, 10:45 am, [email protected] wrote:
>  >Just checked out trunk of nevow and stumbled over the following
> 
> Can you un-snip this traceback and provide more details as to how you 
> produced this?  Better yet, provide a (tested) patch?
> 
> I haven't had the opportunity to use Nevow on Windows at all lately, so 
> it's unlikely I'll get to it myself.
> 
>  >...snip
>  >   ...\nevow\testutil.py", line 5, in <module>
>  >     from popen2 import Popen3
>  >exceptions.ImportError: cannot import name Popen3
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Divmod-dev mailing list
> [email protected]
> http://divmod.org/users/mailman.twistd/listinfo/divmod-dev
traceback.txt (text/plain, 1.7 KB)
Traceback (most recent call last):
  File "C:\proj\twisted\twisted\application\app.py", line 406, in run
    runApp(config)
  File "C:\proj\twisted\twisted\scripts\twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "C:\proj\twisted\twisted\application\app.py", line 159, in run
    self.application = self.createOrGetApplication()
  File "C:\proj\twisted\twisted\application\app.py", line 234, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "C:\proj\twisted\twisted\application\app.py", line 245, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "C:\proj\twisted\twisted\application\service.py", line 341, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)
  File "C:\proj\twisted\twisted\persisted\sob.py", line 215, in loadValueFromFile
    exec fileObj in d, d
  File "examples.tac", line 20, in <module>
    from nevow import inevow, rend, loaders, url, tags, appserver, static, guard, athena
  File "C:\proj\nevow\Nevow\nevow\__init__.py", line 143, in <module>
    load(basic_adapters)
  File "C:\proj\nevow\Nevow\nevow\__init__.py", line 30, in load
    _namedAnyWithBuiltinTranslation(clean(o)),
  File "C:\proj\nevow\Nevow\nevow\util.py", line 183, in _namedAnyWithBuiltinTranslation
    return namedAny(name)
  File "C:\proj\twisted\twisted\python\reflect.py", line 361, in namedAny
    topLevelPackage = __import__(trialname)
  File "C:\proj\nevow\Nevow\nevow\testutil.py", line 5, in <module>
    from popen2 import Popen3
exceptions.ImportError: cannot import name Popen3

Failed to load application: cannot import name Popen3