Skip to content

fix(bindings/python): track writer position for file tell#7477

Open
zhengkezhou1 wants to merge 1 commit intoapache:mainfrom
zhengkezhou1:fix/python-file-writer-tell
Open

fix(bindings/python): track writer position for file tell#7477
zhengkezhou1 wants to merge 1 commit intoapache:mainfrom
zhengkezhou1:fix/python-file-writer-tell

Conversation

@zhengkezhou1
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #6373

Rationale for this change

opendal.File opened in write mode currently supports sequential writes, but calling tell() on it fails because writer state does not track the current output position.

This change makes write-only files report their current sequential write position without adding seek support or changing the underlying object storage write semantics.

What changes are included in this PR?

  • Track the number of bytes successfully written by sync and async Python File writers.
  • Add sync and async tests to verify tell() starts at 0 and advances after writes.

Are there any user-facing changes?

Yes. Python opendal.File and opendal.AsyncFile opened with mode="wb" now support tell() for reporting the current sequential write position.

AI Usage Statement

This PR was developed with assistance from OpenAI ChatGPT5.5/Codex.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: python - S3 operator.open (opendal.File) hangs indefinitely while trying to write pyarrow table

1 participant