Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit dbae485

Browse files
committed
address feedback
1 parent b06a695 commit dbae485

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

google/cloud/storage/fileio.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class BlobWriter(io.BufferedIOBase):
231231
232232
:type text_mode: bool
233233
:param text_mode:
234-
(Deprecated) A synynom for pass_on_flush. For backwards-compatibility,
234+
(Deprecated) A synonym for ignore_flush. For backwards-compatibility,
235235
if True, sets ignore_flush to True. Use ignore_flush instead. This
236236
parameter will be removed in a future release.
237237
@@ -406,15 +406,14 @@ def tell(self):
406406
return self._buffer.tell() + len(self._buffer)
407407

408408
def flush(self):
409-
if self._ignore_flush:
410-
# TextIOWrapper expects this method to succeed before calling close().
411-
return
412-
413-
raise io.UnsupportedOperation(
414-
"Cannot flush without finalizing upload. Use close() instead, or "
415-
"set ignore_flush=True when constructing this class (see "
416-
"docstring)."
417-
)
409+
# flush() is not fully supported by the remote service, so raise an
410+
# error here, unless self._ignore_flush is set.
411+
if not self._ignore_flush:
412+
raise io.UnsupportedOperation(
413+
"Cannot flush without finalizing upload. Use close() instead, "
414+
"or set ignore_flush=True when constructing this class (see "
415+
"docstring)."
416+
)
418417

419418
def close(self):
420419
self._checkClosed() # Raises ValueError if closed.

0 commit comments

Comments
 (0)