Fix a breakage encountered with Mercurial and different Python versions.
Review Request #8806 — Created March 9, 2017 and submitted
For many years, we've had unit test breakages with the Mercurial unit tests, and these would sometimes appear random. Some people hit them, some didn't, and a reinstall often fixed the issue. The problem turned out to be due to setting PYTHONPATH before executing hg, causing it to try to load modules potentially compiled under a different version of Python. In retrospect, this seems pretty obvious. The reason we set PYTHONPATH originally was so that rbssh would have access to the correct modules when it runs. However, this wasn't enough to truly solve the problem, and we ended up fixing this in a different way (setting/restoring RBSITE_PYTHONPATH) a year after making the change to set PYTHONPATH. This means that we were unnecessarily setting PYTHONPATH when calling out to SCMTool-related binaries, breaking Mercurial. This change simply removes the PYTHONPATH setting. If PYTHONPATH was set in the parent process, this will continue to go through to the binary, but we're no longer setting it explicitly.
Unit tests pass under Python 2.6 and 2.7, including rbssh tests.
Previously, I was hitting the hg issue.Checked that none of the other binaries we called out to would be
negatively affected by this change, and that rbssh was still ending up
with the right PYTHONPATH.
Description | From | Last Updated |
---|---|---|
'sys' imported but unused |
reviewbot |
- Testing Done:
-
~ Unit tests pass under Python 2.6 and 2.7. Previously, I was hitting the
~ hg issue. ~ Unit tests pass under Python 2.6 and 2.7, including rbssh tests.
~ Previously, I was hitting the hg issue. + + Checked that none of the other binaries we called out to would be
+ negatively affected by this change, and that rbssh was still ending up + with the right PYTHONPATH.