Skip to content

Commit

Permalink
Resolve symbolic links for environment metadata (#2686)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Feb 21, 2024
1 parent cad5500 commit c221b32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/virtualenv/create/pyenv_cfg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import logging
import os
from collections import OrderedDict


Expand Down Expand Up @@ -32,7 +33,8 @@ def write(self):
logging.debug("write %s", self.path)
text = ""
for key, value in self.content.items():
line = f"{key} = {value}"
normalized_value = os.path.realpath(value) if value and os.path.exists(value) else value
line = f"{key} = {normalized_value}"
logging.debug("\t%s", line)
text += line
text += "\n"
Expand Down

0 comments on commit c221b32

Please sign in to comment.