File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,16 @@ downloads and None for most uploads. Note that ranged downloads ("start" or
85
85
"end" set) still do not support any checksumming, and some features in
86
86
`transfer_manager.py ` still support crc32c only.
87
87
88
+ Note: The method `Blob.upload_from_file() ` requires a file in bytes mode, but
89
+ when checksum is set to None, as was the previous default, would not throw an
90
+ error if passed a file in string mode under some circumstances. With the new
91
+ defaults, it will now raise a TypeError. Please use a file opened in bytes
92
+ reading mode as required.
93
+
88
94
Miscellaneous
89
95
~~~~~~~~~~~~~
90
96
91
- - The BlobWriter class now attempts to terminate an ongoing resumable upload if
97
+ - The ` BlobWriter ` class now attempts to terminate an ongoing resumable upload if
92
98
the writer exits with an exception.
93
99
- Retry behavior is now identical between media operations (uploads and
94
100
downloads) and other operations, and custom predicates are now supported for
Original file line number Diff line number Diff line change @@ -233,8 +233,8 @@ def test_upload_blob_from_memory(test_bucket, capsys):
233
233
234
234
235
235
def test_upload_blob_from_stream (test_bucket , capsys ):
236
- file_obj = io .StringIO ()
237
- file_obj .write ("This is test data." )
236
+ file_obj = io .BytesIO ()
237
+ file_obj .write (b "This is test data." )
238
238
storage_upload_from_stream .upload_blob_from_stream (
239
239
test_bucket .name , file_obj , "test_upload_blob"
240
240
)
You can’t perform that action at this time.
0 commit comments