Skip to content

Replace os.system() calls with pathlib for cross-platform test compatibility#343

Merged
jordanpadams merged 4 commits intofeature/skip-symlinks-340from
copilot/sub-pr-341-again
Feb 17, 2026
Merged

Replace os.system() calls with pathlib for cross-platform test compatibility#343
jordanpadams merged 4 commits intofeature/skip-symlinks-340from
copilot/sub-pr-341-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 12, 2026

Tests used os.system("touch ...") and os.system("mkdir ...") which are non-portable to Windows and vulnerable to path injection with spaces or special characters.

Changes

  • Replaced os.system("touch ...") with pathlib.Path(...).touch()
  • Replaced os.system("mkdir ...") with Path(...).mkdir()
  • Imported pathlib.Path module

Example

# Before
os.system(f"touch {join(self.working_dir.name, 'test_file.txt')}")
os.system(f"mkdir {join(self.working_dir.name, 'test_dir')}")

# After
Path(self.working_dir.name, 'test_file.txt').touch()
Path(self.working_dir.name, 'test_dir').mkdir()

Affects test_resolve_ingress_paths, test_ingress_path_filtering, and test_resolve_ingress_paths_skip_symlinks.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 12, 2026 21:02
…ility

Co-authored-by: jordanpadams <33492486+jordanpadams@users.noreply.github.com>
Co-authored-by: jordanpadams <33492486+jordanpadams@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix feedback on '--skip-symlinks' flag implementation Replace os.system() calls with pathlib for cross-platform test compatibility Feb 12, 2026
Copilot AI requested a review from jordanpadams February 12, 2026 21:04
@jordanpadams jordanpadams marked this pull request as ready for review February 12, 2026 21:56
@jordanpadams jordanpadams requested a review from a team as a code owner February 12, 2026 21:56
Copy link
Copy Markdown
Member

@nutjob4life nutjob4life left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta: ✓
Tests: ✓
Approval: ✅
Tox details:

  py313: OK (22.33=setup[1.71]+cmd[20.63] seconds)
  docs: OK (1.18=setup[0.56]+cmd[0.62] seconds)
  lint: OK (2.77=setup[0.01]+cmd[2.76] seconds)
  congratulations :) (26.36 seconds)

@jordanpadams jordanpadams merged commit c5409da into feature/skip-symlinks-340 Feb 17, 2026
1 check passed
@jordanpadams jordanpadams deleted the copilot/sub-pr-341-again branch February 17, 2026 19:49
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.

3 participants