From c15744914ea2652bbdbc6a2b8d7658369348d390 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 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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..9b034091366 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -139,7 +139,7 @@ def get_scheme( scheme = Scheme( platlib=paths["platlib"], purelib=paths["purelib"], - headers=os.path.join(paths["include"], dist_name), + headers=os.path.join(paths["include"], dist_name or "UNKNOWN"), scripts=paths["scripts"], data=paths["data"], )