Description
Bug report
Bug description:
See https://discuss.python.org/t/venv-not-function-properly-in-macos-within-an-exfat-disk/26145 for the original report.
MacOS creates "._" files with additional metadata when there is metadata (such as extended attributes) that the filesystem doesn't support natively.
To reproduce (I did this on macOS 13 to match the forum message, likely also happens on 14):
-
Create a disk image with the exFAT format and mount this
-
Create a virtual environment on this volume and active this
-
Install setup tools (which ships with a PTH file name
distutils-precedence.pth
) -
Use the "Get Info" context menu in the finder for the PTH file and add a note to the metadata
There should now be a
._distutils-precedence.pth
fileAlternatively: use
xattr -w name value distutils-precedence.pth
to write an extended attribute. -
Start "python"
This should fail with a UnicodeDecodeError in site.py
CPython versions tested on:
3.12
Operating systems tested on:
macOS