<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#330033" bgcolor="#ffffff">
On 11/22/2010 8:33 AM, Guido van Rossum wrote:
<blockquote
cite="mid:AANLkTikdqnqpVAbqV6q_=ji+R_+eaPWNLL2g4gqB_Hm-@mail.gmail.com"
type="cite">
<pre wrap="">On Sun, Nov 21, 2010 at 9:40 PM, Glenn Linderman <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:v+python@g.nevcal.com"><v+python@g.nevcal.com></a> wrote:
</pre>
<blockquote type="cite" style="color: rgb(0, 0, 0);">
<pre wrap=""><span class="moz-txt-citetags">> </span>In reviewing my notes from my experimentations with CGIHTTPServer
<span class="moz-txt-citetags">> </span>(Python2.6) and then http.server (Python 3.2a4), I note one behavior I
<span class="moz-txt-citetags">> </span>haven't reported as a bug, nor do I know where to start to figure it out,
<span class="moz-txt-citetags">> </span>other than experimentally.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>The experiment: launching CGIHTTPServer without environment variables, by
<span class="moz-txt-citetags">> </span>the simple expedient of using a batch file to unset all the existing
<span class="moz-txt-citetags">> </span>environment variables, and then launching Python2.6 with CGIHTTPServer.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>So it failed early: random.py fails at line 110 (Python 2.6).
</pre>
</blockquote>
<pre wrap="">What specific traceback do you get? In my copy of the code that line says
a = long(_hexlify(_urandom(16)), 16)
and I could just imagine that _urandom() fails for some reason to do
with the environment (it is a reference to os.urandom()), which, being
part of the C library code, might depend on the environment.
But you're not giving enough info to debug this.
</pre>
</blockquote>
<br>
OK, here is the traceback. I've upgraded the application from
Python 2.6 + CGIHTTPServer.py + bugfixes to Python 3.2a4 +
http.server + bugfixes, hoping that it would fix it, but since it
didn't that the traceback would be more relevant. It seems that
_urandom is the likely culprit.<br>
<br>
Traceback (most recent call last):<br>
File "d:\my\web\areliabl\0test\https.py", line 5, in
<module><br>
import server<br>
File "d:\my\web\areliabl\0test\server.py", line 88, in
<module><br>
import email.message<br>
File "C:\Python32\lib\email\message.py", line 17, in
<module><br>
from email import utils<br>
File "C:\Python32\lib\email\utils.py", line 27, in <module><br>
import random<br>
File "C:\Python32\lib\random.py", line 698, in <module><br>
_inst = Random()<br>
File "C:\Python32\lib\random.py", line 90, in __init__<br>
self.seed(x)<br>
File "C:\Python32\lib\random.py", line 108, in seed<br>
a = int.from_bytes(_urandom(32), 'big')<br>
WindowsError: [Error -2146893818] Invalid Signature<br>
</body>
</html>