Skip to content

Add fuzzer for io module#43

Open
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-io-fuzzer
Open

Add fuzzer for io module#43
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-io-fuzzer

Conversation

@AdamKorcz
Copy link
Copy Markdown
Contributor

@AdamKorcz AdamKorcz commented Apr 10, 2026

Fuzzes CPython's I/O C implementations under Modules/_io/. Dispatches per input across seven targets: BytesIO (write/seek/read/readline, readinto a pre-allocated buffer, getbuffer, truncate at a fuzzed position, getvalue); TextIOWrapper over a BytesIO with a fuzzed encoding (utf-8, latin-1, ascii, utf-16) and newline mode (None, "", \n, \r, \r\n) to drive decoding and newline translation, then detach; BufferedReader / BufferedWriter / BufferedRandom over a raw BytesIO to exercise the buffering layer; FileIO against a real temp file in read or write mode to hit the fd-backed path; io.open() for the mode-dispatched high-level wrapper; IncrementalNewlineDecoder driven through decode/getstate/reset with the translate flag toggled; and StringIO for the in-memory text stream.

@AdamKorcz AdamKorcz requested a review from a team as a code owner April 10, 2026 19:56
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz marked this pull request as ready for review April 22, 2026 20:39
Fuzzes CPython's I/O C implementations under Modules/_io/. Dispatches
per input across seven targets: BytesIO (write/seek/read/readline,
readinto a pre-allocated buffer, getbuffer, truncate at a fuzzed
position, getvalue); TextIOWrapper over a BytesIO with a fuzzed
encoding (utf-8, latin-1, ascii, utf-16) and newline mode (None,
"", \n, \r, \r\n) to drive decoding and newline translation, then
detach; BufferedReader / BufferedWriter / BufferedRandom over a raw
BytesIO to exercise the buffering layer; FileIO against a real temp
file in read or write mode to hit the fd-backed path; io.open() for
the mode-dispatched high-level wrapper; IncrementalNewlineDecoder
driven through decode/getstate/reset with the translate flag toggled;
and StringIO for the in-memory text stream.
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.

1 participant