Xuanwo opened a new pull request, #8749:
URL: https://github.com/apache/opendal/pull/8749

   # Which issue does this PR close?
   
   Closes #5270.
   
   # Rationale for this change
   
   `Operator.open` and `AsyncOperator.open` already accept binary `r`, `w`, and 
`a` modes, but reject Python's `x` mode for exclusive creation. The binding 
already exposes `if_not_exists` writes, so create mode can provide the same 
guarantee without adding a new core operation.
   
   # What changes are included in this PR?
   
   - Parse `x`, `xb`, and `bx` in the shared open mode parser and set 
`if_not_exists(true)` for writers.
   - Reject contradictory `append` / `if_not_exists` keyword combinations with 
`ValueError`.
   - Document the binary-only modes, exclusive-create behavior, 
`ConditionNotMatch` on an existing path, and wrapping with `io.TextIOWrapper` 
for text I/O in the Rust docs, generated stubs, and Python guide.
   - Add sync and async tests for append creating a missing file, exclusive 
create, unchanged contents when create fails, capability gating, invalid/text 
modes, and conflicting options.
   
   # Are there any user-facing changes?
   
   Yes. `Operator.open` and `AsyncOperator.open` now accept `"x"`, `"xb"`, and 
`"bx"`. They create a new file and raise `ConditionNotMatch` if the path 
already exists. The operation requires `write_with_if_not_exists` and raises 
`Unsupported` when it is unavailable. Text and update modes remain unsupported.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - **Harness:** pi coding agent
   - **Model:** group/deepseek
   - **Effort:** max
   - **Role:** Implemented the mode mapping, conflict checks, tests, and 
documentation, and verified the binding against memory and fs.
   


-- 
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]

Reply via email to