On Mon, Mar 26, 2012 at 03:18:19AM +0500, Boris Bobrov wrote: > Package: python2.7 > Version: 2.7.3~rc2-1 > Severity: normal > > Dear Maintainer, > > After upgrade from 2.7.2-10 to 2.7.3~rc2-1 os.urandom disappeared in python > executables, stored in virtualenvs: > > ---- > (env)breton ~/src/cm/cm % which python > /home/breton/src/cm/env/bin/python > (env)breton ~/src/cm/cm % python > Python 2.7.2+ (default, Oct 4 2011, 15:44:37) > >>> import os > >>> os.urandom > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > AttributeError: 'module' object has no attribute 'urandom' > >>> > > (env)breton ~/src/cm/cm % deactivate > breton ~/src/cm/cm % python > Python 2.7.3rc2 (default, Mar 21 2012, 16:14:45) > >>> import os > >>> os.urandom > <built-in function urandom> > >>> From http://www.virtualenv.org/en/latest/news.html :
Warning: Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that will cause “import random” to fail with “cannot import name urandom” on any virtualenv created on a Unix host with an earlier release of Python 2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to the fact that a virtualenv uses the system Python’s standard library but contains its own copy of the Python interpreter, so an upgrade to the system Python results in a mismatch between the version of the Python interpreter and the version of the standard library. It can be fixed by removing $ENV/bin/python and re-running virtualenv on the same target directory with the upgraded Python. That is, again, what you get when you copy distribution-provided files :-/ -- WBR, wRAR
signature.asc
Description: Digital signature