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

Thomas Heller theller at python.net
Tue Jul 6 15:31:50 EDT 2004


Skip Montanaro <skip at pobox.com> writes:

>     >> Failing that, can I coax someone into building such a beast for me so
>     >> I can include it on http://sourceforge.net/projects/watch/?
>
>     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\watch.py(235)__init__()
>
> 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\watch.py --debug
Traceback (most recent call last):
  File "c:\python23\Scripts\watch.py", line 668, in ?
    main(sys.argv[1:])
  File "c:\python23\Scripts\watch.py", line 612, in main
    server=server, port=port)
  File "c:\python23\Scripts\watch.py", line 326, in __init__
    self.setup_server(server, port)
  File "c:\python23\Scripts\watch.py", line 356, in setup_server
    pid = os.spawnvp(os.P_NOWAIT, cmd, args)
AttributeError: 'module' object has no attribute 'spawnvp'
> c:\python23\scripts\watch.py(356)setup_server()
-> pid = os.spawnvp(os.P_NOWAIT, cmd, args)
(Pdb)

Thomas



More information about the Python-list mailing list