Skip to content

Support parsing non-seekable streams - #604

Open
probberechts wants to merge 1 commit into
PySport:masterfrom
probberechts:fix-issue-469
Open

Support parsing non-seekable streams#604
probberechts wants to merge 1 commit into
PySport:masterfrom
probberechts:fix-issue-469

Conversation

@probberechts

@probberechts probberechts commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Some deserializers (such as Wyscout and SkillCorner) support multiple data formats. The format can either be specified explicitly or detected automatically. Auto-detection reads part of the input to extract version information before parsing the file again from the start. While this works for local files, it fails for non-seekable streams, such as files accessed over S3 or HTTPS.

To fix this, this commit makes open_as_file buffer direct file-like objects that are not seekable into a seekable BufferedStream, consistent with adapter-backed input behavior. It also modifies Wyscout and Skillcorner parsers to open the event stream once and pass the opened seekable object down for version identification before finally parsing.

Fixes #469

Some deserializers (such as Wyscout and SkillCorner) support multiple
data formats. The format can either be specified explicitly or detected
automatically. Auto-detection reads part of the input to extract version
information before parsing the file again from the start. While this works for
local files, it fails for non-seekable streams, such as files accessed over S3
or HTTPS.

To fix this, this commit makes open_as_file buffer direct file-like objects that
are not seekable into a seekable BufferedStream, consistent with adapter-backed
input behavior. It also modifies Wyscout and Skillcorner parsers to open the
event stream once and pass the opened seekable object down for version
identification before finally parsing.

Fixes PySport#496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement: make data format work for non-seekable files

1 participant