From: Jason R. Coombs Date: Sun, 7 Dec 2025 20:24:25 +0000 (-0500) Subject: Restore logic where existance and directoriness are checked on realpath. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ca2bcf843337c8acf62a2d09afa6c02262320c7;p=thirdparty%2FPython%2Fcpython.git Restore logic where existance and directoriness are checked on realpath. --- diff --git a/Lib/pdb.py b/Lib/pdb.py index a2930b5a8542..33ac6a13640f 100644 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -183,15 +183,15 @@ class _ExecutableTarget: class _ScriptTarget(_ExecutableTarget): def __init__(self, target): - if not os.path.exists(target): + self._target = self._safe_realpath(target) + + if not os.path.exists(self._target): print(f'Error: {target} does not exist') sys.exit(1) - if os.path.isdir(target): + if os.path.isdir(self._target): print(f'Error: {target} is a directory') sys.exit(1) - self._target = self._safe_realpath(target) - # If PYTHONSAFEPATH (-P) is not set, sys.path[0] is the directory # of pdb, and we should replace it with the directory of the script if not sys.flags.safe_path: