We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38e9bbe commit c0c9596Copy full SHA for c0c9596
news/6823.bugfix.rst
@@ -0,0 +1 @@
1
+Better preserve original casing when a path is displayed.
src/pip/_internal/utils/misc.py
@@ -190,9 +190,10 @@ def rmtree_errorhandler(
190
def display_path(path: str) -> str:
191
"""Gives the display value for a given path, making it relative to cwd
192
if possible."""
193
- path = os.path.normcase(os.path.abspath(path))
194
- if path.startswith(os.getcwd() + os.path.sep):
195
- path = "." + path[len(os.getcwd()) :]
+ abs_path, cwd = os.path.abspath(path), os.getcwd()
+ common = os.path.commonpath([cwd, abs_path])
+ if len(common) == len(cwd):
196
+ return "." + abs_path[len(common) :]
197
return path
198
199
0 commit comments