This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Case mismatch between "include" and "Include"
Type: behavior Stage:
Components: Windows Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, indygreg, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-08-30 21:48 by indygreg, last changed 2022-04-11 14:59 by admin.

Messages (3)
msg376131 - (view) Author: Gregory Szorc (indygreg) * Date: 2020-08-30 21:48
On Windows, `sysconfig.get_path('include')` returns `Include` (capital I).

However, the actual installation path is `include` (lowercase i).

I believe the reason for the case mismatch is in this code in PC/layout/main.py:

```
    if ns.include_dev:

        for dest, src in rglob(ns.source / "Include", "**/*.h"):
            yield "include/{}".format(dest), src
        src = ns.source / "PC" / "pyconfig.h"
        yield "include/pyconfig.h", src
```

The case mismatch is relevant for case sensitive filesystems. In my case, I was extracting a Windows Python install on Linux and then using the `sysconfig` value to locate directories within that install. Due to the case mismatch, Linux says `Include` doesn't exist since `sysconfig` points to "include."

Case only renames can be a bit wonky to perform. I would suggest preserving what is shipped today and changing `sysconfig` to advertise lowercase "include." However, this would create a mismatch between the cpython source repo and built distributions. So maybe attempting the case-only rename is doable.

Note that Windows will not allow you to have a file/directory varying only in case. i.e. you can have both an "include" and "Include." I can't recall if you can perform a case-only rename with a single system call (meaning it is atomic) or whether you need to go through a temporary directory.
msg376172 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-08-31 23:11
Unfortunately, it's easier to change what we distribute, except that has _always_ been "include" (based on a 2.4 installer I had laying around). And of course we can't change the repo.

Still, case sensitivity is becoming more acceptable on Windows and there are more ways to enable it, so we're probably best to deal with this. For 3.10, we can update PC/layout/main.py and tools/msi/common.wxs#L80 to create "Include", and we probably want to go over the few places where we may reference it to make sure the case is consistent. (Noting that distutils is fully deprecated in 3.10, so it doesn't matter.)

I'm not sure that it qualifies as enough of a bugfix for 3.8 or 3.9.1, so I think we'll leave them alone. A case-sensitive file system can easily support a symlink/junction from "Include" to "include" anyway, which is a pretty straightforward workaround ;)
msg379344 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 20:44
Is this the same as #24908 ?
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85835
2020-10-22 20:44:59eric.araujosetnosy: + eric.araujo
messages: + msg379344
2020-08-31 23:11:44steve.dowersetmessages: + msg376172
versions: + Python 3.10, - Python 3.8
2020-08-30 21:48:06indygregcreate