Skip to content

Commit e58f08d

Browse files
committed
re-add _pth file
this was originally removed since it seemed to be redundant however, somehow a few people have ended up with the env var, breaking their install
1 parent b1f18eb commit e58f08d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

prepare_release.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,18 @@ def _zip_dlls(zip_file: ZipFile, install_dir: Path) -> None:
260260

261261
zip_file.write(file, dest)
262262

263+
# We're adding a '._pth' file which is equivalent to the default. For most people, this doesn't
264+
# do anything. However, if someone has a global `PYTHONPATH`/`PYTHONHOME` env var, without this
265+
# file the interpreter would try use them instead.
266+
py_stem = next(install_dir.glob("python*.zip")).stem
267+
zip_file.writestr(
268+
str(ZIP_PLUGINS_FOLDER / (py_stem + "._pth")),
269+
(
270+
f"{py_stem}.zip\n" # dummy comment to force multiline
271+
"DLLs\n"
272+
),
273+
)
274+
263275

264276
def zip_release(
265277
output: Path,

0 commit comments

Comments
 (0)