Skip to content

Commit

Permalink
escape string in __VIRTUAL_ENV__ path for bash
Browse files Browse the repository at this point in the history
Fixes issue pypa#53 in bash and shell by using the printf %q "shell quote" formatter, which escapes as appropriate for a given environment. Falls back to quoting some characters that universally need to be escaped. Fallback is needed because there are several printf implementations, not all of which are guaranteed to have the %q formatter (though bash always should).

uncompressed diff here: davidbstein/virtualenv_decompressed_scripts@0bc6629
  • Loading branch information
davidbstein committed Oct 18, 2015
1 parent 567f477 commit 8adca33
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1880,19 +1880,20 @@ def convert(s):

##file activate.sh
ACTIVATE_SH = convert("""
eJytVV1v2jAUffevuATUtd0YYo+bmEZVJJBaqBrWaVsn1ySXxlpwkO1Q6Md/n50vElK6h5YHSHyP
r4/vOffShGnAFcx5iLCIlYYZQqzQhzuuA3BUFEsPYcZFh3mar5hGB47nMlrAjKngmDRhE8XgMSEi
DTIWwDX4XKKnww0hPua74PAIHgiYTywUamjPYbnxI48ka02QaFej0AcUKy4jsUChYcUkZ7MQVYLi
c2jAb2jfg9N6oJOzU3o1upx+75/Ri/50+J4+OfAHvoAOUCR4+7GRntOqoZ0CgetlJHUCLNZSjrVN
SXzO/0fm53Q4GQ8n54M9lIp4jVgRqdMrQi+SrKIM1ay8icgqiGJTYB+1kSfRD5jw4V4FH+Au4F4A
AVshMPNjQl60WNiwDphOrJGlMgbxWBgai+gIbg0Do7h5mkfSviyZ8VC2VX0E+GFsFMU6C2subrM0
FaAtELRsicELmLhFBXfGj8y3Xxuw3jLHGo8sDXP0cwFM+YUt/0nfHbaTUj8+Fou/3CG9Gly6o8m4
/ZwMySXbEj597fi46og4DCtFe0Fgt7tHWbdbk9Tt1rV0uy+KmIVzIikkjw7GV9vrNyy3rr1eDxwR
CR+VlrFtOdyh1wQXwznkgMYOgbYN5b2an/5ETHuncS4lhrhilZ4sdXf1bEJKbHsOpaVXSh2S1aF8
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qrFaPkkkLnr3f9sadPNa2drt89ytBGSNwen1LU5ezc6p1e9O3Lq/Hw
clLx+a6v9GmZIeOM5nqrc5JDS13rwnqPu6vwbUYMBJbRR3dqyiAjC4RpSfKpedeE7c50phb6Q79z
HYbkD4KIOOoJEzESUCKS74amT+WhABJwJO5GU+VoFBGFxobC7cFBOZNhJPD8A7XcqJHFoLVI85iN
72bSC+8yRd9hgr5xer5lcr40NVWt/gFBkHAF
""")

##file activate.fish
Expand Down

0 comments on commit 8adca33

Please sign in to comment.