Skip to content

Align Path.open positional arguments - #158

Open
lin-hongkuan wants to merge 1 commit into
jaraco:mainfrom
lin-hongkuan:codex/path-open-buffering-signature
Open

lin-hongkuan wants to merge 1 commit into
jaraco:mainfrom
lin-hongkuan:codex/path-open-buffering-signature

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • align Path.open() positional parameters with pathlib.Path.open() (buffering, encoding, errors, newline)
  • keep the existing legacy Path.open("r", "utf-8") positional encoding form working
  • add regression coverage for Path.open("r", 1) and for the public signature order

Fixes #128

Testing

  • python -m pytest tests/test_path.py -q
  • python -m pytest -q --ignore=tests/test_complexity.py
  • python -m ruff check zipp/__init__.py tests/test_path.py
  • git diff --check

I also ran python -m pytest -q; it failed only in two existing flaky big-O performance tests in tests/test_complexity.py (test_glob_depth and test_implied_dirs_performance).

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.

Path.open() signature differs from pathlib, open() builtin

1 participant