<!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">&lt;v+python@g.nevcal.com&gt;</a> wrote:
</pre>
      <blockquote type="cite" style="color: rgb(0, 0, 0);">
        <pre wrap=""><span class="moz-txt-citetags">&gt; </span>In reviewing my notes from my experimentations with CGIHTTPServer
<span class="moz-txt-citetags">&gt; </span>(Python2.6) and then http.server (Python 3.2a4), I note one behavior I
<span class="moz-txt-citetags">&gt; </span>haven't reported as a bug, nor do I know where to start to figure it out,
<span class="moz-txt-citetags">&gt; </span>other than experimentally.
<span class="moz-txt-citetags">&gt;</span>
<span class="moz-txt-citetags">&gt; </span>The experiment: launching CGIHTTPServer without environment variables, by
<span class="moz-txt-citetags">&gt; </span>the simple expedient of using a batch file to unset all the existing
<span class="moz-txt-citetags">&gt; </span>environment variables, and then launching Python2.6 with CGIHTTPServer.
<span class="moz-txt-citetags">&gt;</span>
<span class="moz-txt-citetags">&gt; </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.&nbsp; 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.&nbsp; It seems that
    _urandom is the likely culprit.<br>
    <br>
    Traceback (most recent call last):<br>
    &nbsp; File "d:\my\web\areliabl\0test\https.py", line 5, in
    &lt;module&gt;<br>
    &nbsp;&nbsp;&nbsp; import server<br>
    &nbsp; File "d:\my\web\areliabl\0test\server.py", line 88, in
    &lt;module&gt;<br>
    &nbsp;&nbsp;&nbsp; import email.message<br>
    &nbsp; File "C:\Python32\lib\email\message.py", line 17, in
    &lt;module&gt;<br>
    &nbsp;&nbsp;&nbsp; from email import utils<br>
    &nbsp; File "C:\Python32\lib\email\utils.py", line 27, in &lt;module&gt;<br>
    &nbsp;&nbsp;&nbsp; import random<br>
    &nbsp; File "C:\Python32\lib\random.py", line 698, in &lt;module&gt;<br>
    &nbsp;&nbsp;&nbsp; _inst = Random()<br>
    &nbsp; File "C:\Python32\lib\random.py", line 90, in __init__<br>
    &nbsp;&nbsp;&nbsp; self.seed(x)<br>
    &nbsp; File "C:\Python32\lib\random.py", line 108, in seed<br>
    &nbsp;&nbsp;&nbsp; a = int.from_bytes(_urandom(32), 'big')<br>
    WindowsError: [Error -2146893818] Invalid Signature<br>
  </body>
</html>