[python-win32] Fwd: Importing tempfile (or random) results in disaster...
Kevin Horn
kevin.horn at gmail.com
Thu May 31 18:26:07 CEST 2012
On Thu, May 31, 2012 at 11:09 AM, Tim Golden <mail at timgolden.me.uk> wrote:
> On 31/05/2012 14:40, Kevin Horn wrote:
> > I'm setting up a new machine (Win7) and one of the first things I
> > thought I'd do is install Python, distribute, pip, virtualenv, etc.
> >
> > However, I can't seem to get that far.
> >
> > When trying to install distribute (using distribute_setup.py), I get the
> > following traceback:
> >
> > Traceback (most recent call last):
> > File "distribute_setup.py", line 20, in <module>
> > import tempfile
> > File "C:\Python27\lib\tempfile.py", line 34, in <module>
> > from random import Random as _Random
> > File "C:\Python27\lib\random.py", line 881, in <module>
> > _inst = Random()
> > File "C:\Python27\lib\random.py", line 97, in __init__
> > self.seed(x)
> > File "C:\Python27\lib\random.py", line 111, in seed
> > a = long(_hexlify(_urandom(16)), 16)
> > WindowsError: [Error -2146893818] Invalid Signature
> >
> > "Huh," I thought. "That's weird".
> >
> > A little googling turned up this bug:
> >
> > http://bugs.python.org/issue13524
> >
> > Which has the same traceback, but purports to have something to do with
> > not passing the right environment to the subprocess module (and is
> > marked as "Wontfix").
> >
> > But this doesn't seem to me to be the problem, as I'm not using the
> > subprocess module. In fact, here is the minimal reproducible example on
> > my machine:
> >
> > tfile.py:
> > import tempfile
> >
> >
> >
> > That's it. Just "import tempfile" and Python comes to a screeching
> > halt. In fact, "import random" does this as well, and either one will
> > also cause the traceback from within the interactive interpreter.
> >
> > What's going on here? Is this a Win7 thing? I have 2.7.3 working on XP
> > and Vista without a problem.
>
> Are you inside a virtualenv? There was a venv bug recently
> which manifested itself in a similar way. Hang on...
>
> Have a look around here (not sure exactly which part of the
> thread to pull at) and see if anything rings bells.
>
> http://mail.python.org/pipermail/python-dev/2012-March/118233.html
>
> TJG
>
>
OK, so I have no idea what caused this, but apparently rebooting my machine
fixed it.
I guess that should have been my first instinct (thanks, Windows!). I have
no idea why a reboot would fix this though.
Thanks for the reply though, Tim.
Kevin Horn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120531/b2a6114f/attachment.html>
More information about the python-win32
mailing list