From 5901967e95ae72ec2b5be05bc08e1924e08a604b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 28 Nov 2019 16:17:35 -0500 Subject: Don't do vars and users in abs_file It meant file names could be incorrectly expanded. --- coverage/files.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'coverage/files.py') diff --git a/coverage/files.py b/coverage/files.py index 2836d4e5..5c2ff1ac 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -159,9 +159,8 @@ else: @contract(returns='unicode') -def abs_file(filename): - """Return the absolute normalized form of `filename`.""" - path = os.path.expandvars(os.path.expanduser(filename)) +def abs_file(path): + """Return the absolute normalized form of `path`.""" try: path = os.path.realpath(path) except UnicodeError: -- cgit v1.2.1