build a binary for Windows on Linux, Solaris or Mac OSX?

Thomas Heller theller at
Tue Jul 6 21:31:50 CEST 2004

Skip Montanaro <skip at> writes:

>     >> Failing that, can I coax someone into building such a beast for me so
>     >> I can include it on
>     Thomas> I could do it, although it seems a little work is stil required to port
>     Thomas> watch to Windows:
>     ...
>     Thomas>     self.output = open("/dev/null", "w")
>     Thomas> IOError: [Errno 2] No such file or directory: '/dev/null'
>     >> c:\python23\scripts\
> That's odd.  I've run this lots on Windows in my previous job, and not
> always in debug mode.  I'll fix that.  Is sys.stderr going to be broken on
> Windows?  That is, should I use something other than sys.stderr for debug
> output?

Did you use cygwin?

On Windows, sys.stderr works, and is usually connected to a console
window.  But "/dev/null" doesn't exist.  You could spell it "NUL", or
provide a Python implementation of a "bit sink".

Next problem is that os.spawnvp() doesn't exist on Windows:

c:\>\python23\Scripts\ --debug
Traceback (most recent call last):
  File "c:\python23\Scripts\", line 668, in ?
  File "c:\python23\Scripts\", line 612, in main
    server=server, port=port)
  File "c:\python23\Scripts\", line 326, in __init__
    self.setup_server(server, port)
  File "c:\python23\Scripts\", line 356, in setup_server
    pid = os.spawnvp(os.P_NOWAIT, cmd, args)
AttributeError: 'module' object has no attribute 'spawnvp'
> c:\python23\scripts\
-> pid = os.spawnvp(os.P_NOWAIT, cmd, args)


More information about the Python-list mailing list