8000 gh-120754: Add a strace helper and test set of syscalls for open().read(), Take 2 by cmaloney · Pull Request #123413 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120754: Add a strace helper and test set of syscalls for open().read(), Take 2 #123413

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

Merged
merged 12 commits into from
Nov 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to validate gh-90102 changes
  • Loading branch information
cmaloney committed Oct 8, 2024
commit c2715b122761da7c10cd280301a00c1d6164a004
13 changes: 5 additions & 8 deletions Lib/test/test_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def count_similarname(name):
# Should open and close the file exactly once
("open", 1),
("close", 1),
# There should no longer be an isatty call (All files being
# tested are block devices / not character devices).
('ioctl', 0),
# Should only have one fstat (bpo-21679, gh-120754)
# note: It's important this uses a fd rather than filename,
# That is validated by the `fd` check above.
Expand Down Expand Up @@ -462,21 +465,15 @@ def count_similarname(name):
# GH-122111: read_text uses BufferedIO which requires looking up
# position in file. `read_bytes` disables that buffering and avoids
# these calls which is tested the `pathlib read_bytes` case.
extra_checks=[
("ioctl", 1),
("seek", 1)
]
extra_checks=[("seek", 1)]
)

check_readall(
"pathlib read_bytes",
"p.read_bytes()",
prelude=f"""from pathlib import Path; p = Path("{TESTFN}")""",
# GH-122111: Buffering is disabled so these calls are avoided.
extra_checks=[
("ioctl", 0),
("seek", 0)
]
extra_checks=[("seek", 0)]
)

check_readall(
Expand Down
Loading
0