Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use os.path to avoid os errors for invalid file paths #575

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

jayaseelan-james
Copy link
Contributor

What does this Pull Request accomplish?

Use os.path.exists(path) instead of Path.exists() to swallow OS errors for invalid file paths for older Python versions. AB#2606153

Why should this Pull Request be merged?

When the .env file isn't present in any of the measurement.py parent directories and if TestStand adaptors use any Python version <3.8.10 or <3.9.5, an OSError is thrown for invalid file paths. Using os.path.exists(path) resolves this error.

What testing has been done?

Ran mypy and manually ran the "nidcpower_source_dc_voltage" example's sequence file in TestStand 2021 SP1 with Python versions 3.8.9, 3.8.10, 3.9.4, 3.9.5, 3.9.13 and 3.10.11.

Copy link

github-actions bot commented Dec 30, 2023

Test Results

    26 files   -     4     26 suites   - 4   24m 59s ⏱️ - 12m 32s
   546 tests ±    0    546 ✅ ±    0      0 💤 ±0  0 ❌ ±0 
10 716 runs   - 2 644  9 656 ✅  - 2 644  1 060 💤 ±0  0 ❌ ±0 

Results for commit 5b664c2. ± Comparison against base commit d24454c.

♻️ This comment has been updated with latest results.

@bkeryan bkeryan merged commit 780e378 into main Jan 5, 2024
@jayaseelan-james jayaseelan-james deleted the users/jay/fix-frozen-importlib-error branch January 12, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants