From 3c15b9baeb636feb0d32fccdb5b531061614c802 Mon Sep 17 00:00:00 2001 From: Mike Hendricks Date: Tue, 3 Sep 2024 18:26:47 -0700 Subject: [PATCH] Stop using win32api.GetShortPathName --- .github/workflows/python-static-analysis-and-test.yml | 9 --------- tests/test_env_var.py | 6 ++++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-static-analysis-and-test.yml b/.github/workflows/python-static-analysis-and-test.yml index 0e49e72..9fccccb 100644 --- a/.github/workflows/python-static-analysis-and-test.yml +++ b/.github/workflows/python-static-analysis-and-test.yml @@ -67,17 +67,8 @@ jobs: python -m pip install --upgrade pip python -m pip install tox - - name: Enable 8dot3name - run: | - dir c:\PROGRA~1 - fsutil 8dot3name query d: - fsutil 8dot3name set 0 - fsutil 8dot3name query d: - dir c:\PROGRA~1 - - name: Run Tox run: | - fsutil 8dot3name query d: tox -e begin,py - name: Upload coverage diff --git a/tests/test_env_var.py b/tests/test_env_var.py index eaeb94e..8ec6270 100644 --- a/tests/test_env_var.py +++ b/tests/test_env_var.py @@ -18,7 +18,6 @@ import os import pytest -import win32api from casement.env_var import EnvVar from casement.registry import RegKey @@ -57,7 +56,10 @@ def wrapper(*args, **kwargs): def test_expand_path(): # Generate a short name path. This method needs a file that actually # exists on disk, and test_env_var.py is long enough to get ~'ed - short_name = win32api.GetShortPathName(__file__) + # short_name = win32api.GetShortPathName(__file__) + # Github actions windows servers stopped supporting short names from the + # above command. For now just convert the file name to a short name. + short_name = os.path.join(os.path.dirname(__file__), "TEST_E~1.PY") assert '~' in short_name # Check expandvars argument