new feature: support mode argument in op.open
in python binding correctly
#5270
Labels
enhancement
New feature or request
op.open
in python binding correctly
#5270
Feature Description
The Python binding implements
open
method onOperator
instance, and it's generally expected that the behavior should be compatible with the builtinopen
function. Unfortunately, it's wrong when handling themode
argument.The following arguments are valid for the mode argument:
ref: https://www.manpagez.com/man/3/fopen/
Then in Python 3, all above modes represent TEXT mode, and all read/write methods accept
str
as arguments. An optional charactert
orb
can be attached with the above modes, meansTEXT
andBINARY
.It seems that opendal treat them all as BINARY mode. It's the default behavior, and opendal will not reject invalid modes that it can't support.
Problem and Solution
There are several actions can be taken for the purpose.
a
and+
in modes due to lack of support by the object store interface.enum IoMode { Text, Binary }
to supportb
argument.rb
tort
.Additional Context
No response
Are you willing to contribute to the development of this feature?
The text was updated successfully, but these errors were encountered: