Can I use Python 2.7 modules from Python 2.6? Or do something to achieve the same effect?
I’m limited to use Python 2.6, but an issue exists in the subprocess module provided by Python 2.6. This is fixed in Python 2.7. I’m curious if I rig this up using pip (or equivalent) to sidestep the bug temporarily until upgrading one day. How would I go about doing this?
Etienne Perot suggested using a Python 3.2 subprocess backport available at http://code.google.com/p/python-subprocess32/ instead of hacking around the Python installation.
This let me install the module into my virtual environment’s site-packages, and patch the subprocess code with http://hg.python.org/cpython/rev/767420808a62 to fix the bug mentioned in question. Afterwards, a simple
import subprocess32 as subprocessfixed the problem.