From a5ded57522626691faf91d95ea2051f6d4369d7b Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sun, 25 Apr 2021 04:47:23 +0800 Subject: [PATCH] Set project name to UNKNOWN when empty For compatibility with distutils --- news/9838.bugfix.rst | 1 + src/pip/_internal/locations/_sysconfig.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 news/9838.bugfix.rst diff --git a/news/9838.bugfix.rst b/news/9838.bugfix.rst new file mode 100644 index 00000000000..0ae54bec8a4 --- /dev/null +++ b/news/9838.bugfix.rst @@ -0,0 +1 @@ +Fix compatibility between distutils and sysconfig when the project name is unknown. diff --git a/src/pip/_internal/locations/_sysconfig.py b/src/pip/_internal/locations/_sysconfig.py index e4d66d25d24..7e3ee6a22b9 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -136,6 +136,9 @@ def get_scheme( python_xy = f"python{get_major_minor_version()}" paths["include"] = os.path.join(base, "include", "site", python_xy) + if dist_name is None: + dist_name = "UNKNOWN" + scheme = Scheme( platlib=paths["platlib"], purelib=paths["purelib"],