Skip to content

Commit

Permalink
Resolve cwd using os.path.realpath() when generating environment names
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Gregory (ext) committed Aug 3, 2022
1 parent 83e6c31 commit 874be14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ def get_base_prefix(cls) -> Path:
def generate_env_name(cls, name: str, cwd: str) -> str:
name = name.lower()
sanitized_name = re.sub(r'[ $`!*@"\\\r\n\t]', "_", name)[:42]
normalized_cwd = os.path.normcase(cwd)
normalized_cwd = os.path.realpath(os.path.normcase(cwd))
h_bytes = hashlib.sha256(encode(normalized_cwd)).digest()
h_str = base64.urlsafe_b64encode(h_bytes).decode()[:8]

Expand Down

0 comments on commit 874be14

Please sign in to comment.