Fix Windows Compatibility: Symlink Handling, Permission Fixes, and Test Stability Improvements
What type of PR is this?
/kind bug
/kind cleanup
/kind documentation
What this PR does / why we need it
This PR fixes multiple Windows-specific issues in the Kubernetes Python client repository to improve developer experience, test stability, and compatibility on Windows systems.
Windows environments have limited support for Unix-style symbolic links, and strict file permission semantics caused test failures. Additionally, streaming tests sometimes hung or failed due to differences in environment.
This PR introduces fixes and workarounds for these problems, enabling smooth local development and CI testing on Windows.
Which issue(s) this PR fixes
Fixes #2427
Resolves Windows compatibility issues related to symlinks, file permissions, and flaky tests.
Special notes for your reviewer
- Added a Windows development setup script to replace symlinks with actual directories and files.
- Added Windows-specific permission handling in temporary file tests to avoid PermissionError.
- Added shim modules at repository roots to fix import errors caused by symlink replacement.
- Refactored streaming tests to mock streaming behavior for quick, reliable tests on Windows.
- Updated UTF-8 invalid character tests to accommodate Windows UTF-8 decoding behavior.
- Added comprehensive guidance documentation for Windows developers.
Does this PR introduce a user-facing change?
Fix Windows-specific development environment and test suite issues:
- Support for Windows without symlink failures
- Windows-safe temporary file handling in tests
- Reliable, non-hanging streaming tests and import fixes on Windows
- Documentation for Windows developer setup and troubleshooting
Additional documentation
Added WINDOWS_DEVELOPMENT.md with detailed instructions and troubleshooting steps for setting up development and running tests on Windows platforms.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: PraveenMudalgeri / name: justpraveen (042128c026a71e3fb9e163e9dbbdb68bca3e9a2a, 8377e67abbe1a7f826f5a295a313fba063487a0c, d989d704f5ae043b41ef380cf2e89786ad73cf25, b8024c08cec32bf81500cb3b86c9341313f70fb6, 38b70af7bab9ed2e3925d867093a40df3ac1b082, 0c189cee65ec633f067707e82093241ad1db1e06, 1b14ba58d464af628e631c1c21e37059268ef7ec, 4407601332e74456e9ca7e48c63c239c222da2b8)
Welcome @PraveenMudalgeri!
It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-client/python has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
/release-note-none
Hi @fabianvf and @roycaihw, Could you please review this PR and, if everything looks good, approve it with a /approve comment? Thank you for your time!
/assign
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: PraveenMudalgeri Once this PR has been reviewed and has the lgtm label, please ask for approval from roycaihw. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle rotten - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten