This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients barry, benjamin.peterson, carljm, dmalcolm, eric.araujo, eric.snow, georg.brandl, jaraco, loewis, r.david.murray
Date 2012-04-12.21:34:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334266478.75.0.955749480995.issue14444@psf.upfronthosting.co.za>
In-reply-to
Content
For posterity, here's the release notes that we had drafted on the pirate pad:

Note: This patch release of Python may have compatibility implications for environments utilizing the third-party virtualenv. For more detail see XXX.
[the note above is intended to be included as a line-item in the release notes, referencing the file below]
Upgrade issues with virtualenv
======================
In order to enact a security fix in Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3, the implementation of os.urandom was updated. The implementation of urandom was moved from the os module (Python stdlib) to the posix module (built in to the Python executable binary). As a result, when upgrading a host to one of these new Python versions, virtual environments created with earlier versions of Python will now be missing os.urandom. This issue only exists for Unix hosts.
This happens because the virtualenv bundles the older Python executable (which does not have an implementation of urandom), but then references the newer standard library (in which the os module also does not have an implementation of urandom).
In environments where this error occurs, the error is most likely exhibited as an AttributeError:
    $ $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'
Workaround
=========
The workaround is to remove the 'python' binary from $ENV/bin and re-run virtualenv for the required Python version or versions on that environment. For example:
    $ rm $ENV/bin/python
    $ virtualenv --python python2.7 $ENV
It's necessary to remove the main python binary because virtualenv will not replace it if it already exists. If the virtualenv contained multiple Python versions, run virtualenv on it again with each Python. If the --distribute flag was used in the initial creation of the virtualenv, use it again here.
History
Date User Action Args
2012-04-12 21:34:38jaracosetrecipients: + jaraco, loewis, barry, georg.brandl, benjamin.peterson, carljm, eric.araujo, r.david.murray, dmalcolm, eric.snow
2012-04-12 21:34:38jaracosetmessageid: <1334266478.75.0.955749480995.issue14444@psf.upfronthosting.co.za>
2012-04-12 21:34:38jaracolinkissue14444 messages
2012-04-12 21:34:38jaracocreate