Xuanwo opened a new pull request, #8762: URL: https://github.com/apache/opendal/pull/8762
# Which issue does this PR close? N/A. The bug was verified against the Python binding. # Rationale for this change `File.seek` and `AsyncFile.seek` converted a negative `SEEK_SET` offset with `pos as u64`, so `seek(-1, 0)` wrapped to `u64::MAX` instead of raising. `SEEK_CUR` and `SEEK_END` already use the core reader's checked arithmetic and do not wrap. # What changes are included in this PR? - Reject negative `SEEK_SET` offsets in both sync `File.seek` and async `AsyncFile.seek` with `ValueError` before calling the reader. - Add sync and async regression tests covering `seek(-1, 0)` and `seek(-1)` that verify the exception type and that the cursor position remains unchanged. # Are there any user-facing changes? Yes. A negative `SEEK_SET` offset now raises `ValueError` instead of silently seeking to a wrapped position. # Breaking changes # AI Usage Statement - Harness: pi coding agent - Model: group/deepseek - Effort: max - Role: Implemented the fix and regression tests, ran the Rust and Python checks, and prepared the PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
