From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 14 Oct 2019 16:01:29 +0000 (-0700) Subject: bpo-38453: Resolve test directories before chdir to them (GH-16723) X-Git-Tag: v3.8.1rc1~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa909b6b1242b4969b20bb0250ac386f9b4120d7;p=thirdparty%2FPython%2Fcpython.git bpo-38453: Resolve test directories before chdir to them (GH-16723) (cherry picked from commit d83fc2702951f56a7339aa95d62414ed6e0fb40d) Co-authored-by: Steve Dower --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 2ff7640535e9..d6a7819cb013 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1066,7 +1066,7 @@ def change_cwd(path, quiet=False): """ saved_dir = os.getcwd() try: - os.chdir(path) + os.chdir(os.path.realpath(path)) except OSError as exc: if not quiet: raise