disable libmagic on windows; probably closes #276

This commit is contained in:
ed 2025-07-30 18:02:11 +00:00
parent 053de61907
commit a9d07c63ed
2 changed files with 4 additions and 1 deletions

View file

@ -2226,6 +2226,7 @@ force-enable features with known issues on your OS/env by setting any of the fo
| env-var | what it does | | env-var | what it does |
| ------------------------ | ------------ | | ------------------------ | ------------ |
| `PRTY_FORCE_MP` | force-enable multiprocessing (real multithreading) on MacOS and other broken platforms | | `PRTY_FORCE_MP` | force-enable multiprocessing (real multithreading) on MacOS and other broken platforms |
| `PRTY_FORCE_MAGIC` | use [magic](https://pypi.org/project/python-magic/) on Windows (you will segfault) |
# packages # packages

View file

@ -155,7 +155,9 @@ except:
HAVE_PSUTIL = False HAVE_PSUTIL = False
try: try:
if os.environ.get("PRTY_NO_MAGIC"): if os.environ.get("PRTY_NO_MAGIC") or (
ANYWIN and not os.environ.get("PRTY_FORCE_MAGIC")
):
raise Exception() raise Exception()
import magic import magic