Ampoule 0.1 does not work on Windows XP

Bug #317077 reported by UmitOz
2
Affects Status Importance Assigned to Milestone
Ampoule
Fix Committed
Undecided
dialtone

Bug Description

Hello,

I am trying to run Ampoule on windows. On my windows XP (SP3) machine I got the following error when trying to run the examples:

        Traceback (most recent call last):
          File "c:\python25\lib\site-packages\twisted\internet\defer.py", line 7
37, in _inlineCallbacks
            result = g.send(result)
          File "C:\Documents and Settings\dia\Desktop\ampoule-0.1\examples\pid.p
y", line 25, in _run
            yield pp.start()
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\pool
.py", line 97, in start
            return self.adjustPoolSize()
          File "c:\python25\lib\site-packages\twisted\internet\defer.py", line 8
22, in unwindGenerator
            return _inlineCallbacks(None, f(*args, **kwargs), Deferred())
        --- <exception caught here> ---
          File "c:\python25\lib\site-packages\twisted\internet\defer.py", line 7
37, in _inlineCallbacks
            result = g.send(result)
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\pool.py", line 358, in adjustPoolSize
            self.startAWorker()
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\pool.py", line 192, in startAWorker
            ampParent=self.ampParent)
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\main.py", line 212, in startAMPProcess
            return self.startPythonProcess(prot, self.childReactor, fullPath)
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\main.py", line 228, in startPythonProcess
            usePTY=self.usePTY, packages=self.packages)
          File "c:\python25\lib\site-packages\ampoule-0.1-py2.5.egg\ampoule\main.py", line 260, in spawnProcess
            childFDs={0:"w", 1:"r", 2:"r", 3:"w", 4:"r"})
          File "c:\python25\lib\site-packages\twisted\internet\posixbase.py", line 231, in spawnProcess
            raise ValueError("Customizing childFDs is not supported on Windows.")
        exceptions.ValueError: Customizing childFDs is not supported on Windows.

Any help is appreciated.

dialtone (dialtone)
Changed in ampoule:
assignee: nobody → dialtone
Revision history for this message
dialtone (dialtone) wrote :

Uhm... This is a pretty nasty one. the fix is not so super easy. I committed just now a fix in the repository but it's not yet tested on windows (it works on osx so I suppose also on linux). I'll check on windows during the weekend but in the meantime you might give the new code a try. thanks for reporting.

Revision history for this message
dialtone (dialtone) wrote :

I was forgetting... Notice however that some libraries/software misbehave and write errors on stdout completely breaking communication between parent and child processes. One such example is GTK+. So be warned that windows is not the friendliest guy for processes.

dialtone (dialtone)
Changed in ampoule:
status: New → Fix Committed
Revision history for this message
UmitOz (umit-oztosun-net) wrote :

Thanks for your patch, however I am getting another error while trying to run the example basic.py:
(It goes into an infinite loop)

Unhandled error in Deferred:
Traceback (most recent call last):
  File "c:\python25\lib\site-packages\twisted\internet\defer.py", line 737, in _inlineCallbacks
    result = g.send(result)
  File "C:\Documents and Settings\dia\Desktop\ampoule\examples\basic.py", line 20, in _run
    l = [pp.doWork(Ping) for x in xrange(REPEATS)]
  File "c:\python25\lib\site-packages\ampoule-0.1.1-py2.5.egg\ampoule\pool.py", line 282, in doWork
    self._cb_doWork(command, _d=d, **kwargs)
  File "c:\python25\lib\site-packages\ampoule-0.1.1-py2.5.egg\ampoule\pool.py", line 261, in _cb_doWork
    return defer.maybeDeferred(child.callRemote, command, **kwargs
--- <exception caught here> ---
  File "c:\python25\lib\site-packages\twisted\internet\defer.py", line 106, in maybeDeferred
    result = f(*args, **kw)
  File "C:\Python25\Lib\site-packages\twisted\protocols\amp.py", line 723, in callRemote
    return co._doCommand(self)
  File "C:\Python25\Lib\site-packages\twisted\protocols\amp.py", line 1532, in _doCommand
    self.requiresAnswer)
  File "C:\Python25\Lib\site-packages\twisted\protocols\amp.py", line 657, in _sendBoxCommand
    box._sendTo(self.boxSender)
  File "C:\Python25\Lib\site-packages\twisted\protocols\amp.py", line 482, in _sendTo
    proto.sendBox(self)
  File "C:\Python25\Lib\site-packages\twisted\protocols\amp.py", line 1847, in sendBox
    self.transport.write(box.serialize())
  File "c:\python25\lib\site-packages\ampoule-0.1.1-py2.5.egg\ampoule\main.py", line 73, in write
    self.transport.writeToChild(TO_CHILD, data)
exceptions.AttributeError: Process instance has no attribute 'writeToChild'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.