This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc
Date 2008-06-18.09:28:25
SpamBayes Score 0.056686483
Marked as misclassified No
Message-id <1213781312.07.0.218615060623.issue3133@psf.upfronthosting.co.za>
In-reply-to
Content
On windows, test_httpservers fails with the error:

  File "C:\python\py3k\Lib\http\server.py", line 1104, in run_cgi
    exec(open(scriptfile).read(), {"__name__": "__main__"})
  File "<string>", line 3, in <module>
  File "C:\python\py3k\Lib\socket.py", line 222, in write
    return self._sock.send(b)
  TypeError: send() argument 1 must be bytes or read-only buffer, not str

There are two problems there:
- Lib/http/server.py still looks for os.popen2 or os.popen3 to start a
subprocess; these functions have been removed, this code should be
rewritten using the subprocess module.
- the fallback method, which exec() the cgi script in the python
interpreter, fails because sys.stdout should be set to a TextIOWrapper,
not a binary socket file.

Certainly the fallback method could be removed: every platform
implements subprocess nowadays.
History
Date User Action Args
2008-06-18 09:28:33amaury.forgeotdarcsetspambayes_score: 0.0566865 -> 0.056686483
recipients: + amaury.forgeotdarc
2008-06-18 09:28:32amaury.forgeotdarcsetspambayes_score: 0.0566865 -> 0.0566865
messageid: <1213781312.07.0.218615060623.issue3133@psf.upfronthosting.co.za>
2008-06-18 09:28:30amaury.forgeotdarclinkissue3133 messages
2008-06-18 09:28:29amaury.forgeotdarccreate