Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(internal): adjust pants_venv venv_dir calculation (#19140)
The "uname -mps" output on my machine includes odd chars and is really long: ``` Linux x86_64 Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz ``` As of #18916, the entire python version is a fingerprint instead of 2 chars "39". The longer fingerprint plus my excessively long processor name trips over the shebang max length (127 chars). Once the python interpreter becomes longer than the shebang max length, that triggers distlib's long shebang logic (which writes the shebangs for scripts like `pip` in the `venv/bin` dir), But, that distlib logic breaks with the special uname chars on my machine because distlib does not escape the special chars in the path. https://github.com/pypa/distlib/blob/0.3.6/distlib/scripts.py#L152-L157 So, this bypasses the whole mess by generating one fingerprint for uname + python version and then use that fingerprint (which doesn't have any special chars) in the venv dir name.
- Loading branch information