You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the contents is None there is no chance to later read the file.
In my opinion None in this API should be equivalent to "" - giving an empty file. However at read attempt it raises:
The text was updated successfully, but these errors were encountered:
kamichal
changed the title
create_file(..., contents=None) unintentionally crates a "large file"
create_file(..., contents=None) unintentionally crates a "large file"
Aug 24, 2018
Well, given that the default value for contents is an empty string, you have to explicitely pass None to contents in create_file(), so this has to be a conscious decision. But I agree that handling None contents as empty contents as long as st_size is also None makes sense.
Seems it's a lack in the API:
If the contents is
None
there is no chance to later read the file.In my opinion
None
in this API should be equivalent to""
- giving an empty file. However at read attempt it raises:Of course setting
contents=''
works OK.The text was updated successfully, but these errors were encountered: