Only create a Blob in write mode
This is needed so we can detect attempts to open nonexistent files
in read mode.
@@ -21,6 +21,8 @@ class GoogleCloudFile(File):
self.name = name
self._mode = mode
self._storage = storage
+ self.blob = storage.bucket.get_blob(name)
+ if not self.blob and 'w' in mode:
self.blob = Blob(self.name, storage.bucket)
self._file = None
self._is_dirty = False
