Commits

Brandon Rhodes committed 7616f0a

Bugfix: my path-rewriting algorithm was tramping on PYTHONPATH explicit paths.

Comments (0)

Files changed (2)

 
 ##file site.py
 SITE_PY = """
-eJyNV02P2zYQvftXMN6DZdR2UfSWYg/tIWgvbdGmSIogMGhpZDNLkQJJWet/3zf8kOWNN2gOSSyR
-M/Nm3rwZPYj3JxJn5cIgNZmzWHoVaNdflouF6nrrgrB+I/zFLxYP4gPp2nYkgp1decNvZlYEniln
-TUcmCG2PqhbKC2XO5AM1+I8IONxare2ozFG0g6mDsmYDM07incMBacSXwQfhBmP4UL511PYAD762
-PQnb4hlMd7YZNG3EgWo5eIKZbtBB9fpuSDivjqeA08IHWT8hJAvjtmd7JOuTsBwDRyNNI8YTmfR4
-DquWWnuxpGeqW6WpWi/ZiILxXjocWPlZItnQpYR+lk7JgyafIE3hC9wT9kxudCoEMrvFoqF2lua9
-MipU67cLgT/xrwfxTjkfNmIk0VAg1ylDHDAsRcu9I8/RzsqLp9rWEoXYMLxsx9jAF2WIEIwM6kxc
-8x0stOoZtxAOH9Xq0F/CCVgfwYtdj3LtGuWM7Kja7zkV+/06nsw3H2dm4nNO2f7m5ezJIsfzOz0n
-WI5kEwtfowKo1CymWH0Sf6ZwlEExtZZMpGwkMJ5RegFONEzZGtZCTs0dYmSILUPryVQF3xerTDUB
-34iVdeq4TVHswnNYrRNijg0e9BVdy7+bar3zwam+SsfaXa2tB2UK2J8NatEqg/AvEfSB4wQ0Kbw6
-GgbqSCtq3wjxT89AUnERFpKEg9nOHUigYc7PCXk4EKhcGsqmhgoK1PSELm+zmURHDzidVuYpdix8
-MjGWyML3KQ0fd/8uBSpPdbDushPilyGARiPiz3ZqtLAjZnOmEjBx8DFugdKw+x4NKI80WVJwnAqb
-raR2KijuVMs6obiVnDRHqsDxqjhb514pteFnn9TnQsn0CxXqtaypSkXbvKziRvyQC1VrkmaP1/uI
-5BG94MPVGQfr5ZmrBnG6TExGSiIRE9oI5rZAOQU+CoA8S6VZHsRE4+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IA1YtvuPR
+9RCLNNRH+qcPo3go92gqZwlhj62zJbFyvYEdO+x0exuCbRrrwws7cHSnQi7qPCaYQQdPuO6w6BRp
+jRzVI1OhkbiQIaNRPQ3XJuku4jpIFe+uLJf47QnyWPFUBv04ALjJN9gSWyVjnad2NMET36lU0Yr1
+GkLCt7fhjtxBAGmLLj65Bi7+A/WaQwQ=
 """.decode("base64").decode("zlib")
 
 ##file ez_setup.py

virtualenv_support/site.py

     # modules symlinked into its "lib/pythonX.Y" directory.  But now we
     # can rewrite sys.path to point at the package directories of the
     # parent Python environment.
+    #
+    # Which paths should we rewrite?  Only the ones that Python sets for
+    # itself based on sys.prefix; we should skip the paths (if any) that
+    # come from the PYTHONPATH.
 
-    for i in range(len(sys.path)):
+    if 'PYTHONPATH' in os.environ:
+        skip = os.environ['PYTHONPATH'].count(':') + 1
+    else:
+        skip = 0
+
+    for i in range(skip, len(sys.path)):
         sys.path[i] = sys.path[i].replace(prefix, sys.real_prefix, 1)
 
     clean_sys_path = list(sys.path)  # save a copy