diff --git a/src/pip/_internal/utils/temp_dir.py b/src/pip/_internal/utils/temp_dir.py index d2c42feea28..4475a7d40ae 100644 --- a/src/pip/_internal/utils/temp_dir.py +++ b/src/pip/_internal/utils/temp_dir.py @@ -203,8 +203,7 @@ def cleanup(self): # natively for paths, and the bytes-text conversion omission avoids # errors caused by the environment configuring encodings incorrectly. if WINDOWS: - encoding = sys.getfilesystemencoding() - rmtree(ensure_text(self._path, encoding=encoding)) + rmtree(ensure_text(self._path)) else: rmtree(self._path)