jupyter/jupyter_core

Case-sensitive username on windows test causes failure

jasongrout opened this issue · 2 comments

Building the 4.8.0 conda-forge package, we are seeing a test failure on windows:

https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=377387&view=logs&j=171a126d-c574-5c8c-1269-ff3b989e923d&t=1183ba29-a0b5-5324-8463-2a49ace9e213&l=1068

    def check_user_only_permissions(fname):
        # Windows has it's own permissions ACL patterns
        username = os.environ["USERNAME"]
        permissions = fetch_win32_permissions(fname)
        print(permissions) # for easier debugging
>       assert username in permissions
E       AssertionError: assert 'VssAdministrator' in {'administrators': {'f'}, 'vssadministrator': {'d', 'r', 'w'}}

It seems that the fetch_win32_permissions is giving the lowercase "vssadministrator", while the USERNAME environment variable is cased as "VssAdministrator".

Are usernames in windows case-sensitive?

Well, it looks like we explicitly lowercase the username in the code right above it.

And it looks like we accidentally removed the lowercasing of the username in this function: 2a08a19

Patch coming up to return to lowercasing the username. It does appear from some random googling/duckducking that windows usernames are case insensitive.

Thanks. Releasing 4.8.1 with this now...