[Python-Dev] Virtualenv not portable from Python 2.7.2 to 2.7.3 (os.urandom missing)

David Malcolm dmalcolm at redhat.com
Thu Mar 29 19:39:27 CEST 2012


On Wed, 2012-03-28 at 18:22 +0000, Jason R. Coombs wrote:
> I see this was reported as a debian bug.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=665776
> 
> To reproduce, using virtualenv 1.7+ on Python 2.7.2 on Ubuntu, create
> a virtualenv. Move that virtualenv to a host with Python 2.7.3RC2
> yields:
> jaraco at vdm-dev:~$ /usr/bin/python2.7 -V
> Python 2.7.3rc2
> jaraco at vdm-dev:~$ env/bin/python -V
> Python 2.7.2
> jaraco at vdm-dev:~$ env/bin/python -c "import os; os.urandom()"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'urandom'

It looks like this a symptom of the move of urandom to os.py to
posximodule et al.

At first glance, it looks like this specific hunk should be reverted:
http://hg.python.org/cpython/rev/a0f43f4481e0#l7.1
so that if you're running with the new stdlib but an old python binary
the combination can still have a usable os.urandom

Should this be tracked in bugs.python.org?

Hope this is helpful
Dave



More information about the Python-Dev mailing list