FileNotOpenedError with Cloud storage on GAE
===

I am trying to write to a file in cloud storage from the remote api shell and am seeing the following:

    s~appid> FILENAME = '/gs/test_bucket/test'
    
    s~appid> writable_file = files.gs.create(FILENAME,
    mime_type='application/octet-stream', acl='project-private')
    
    s~appid> with files.open(writable_file, 'a') as f:
              ...     f.write('[]')
              ...
    ---------------------------------------------------------------------------
    FileNotOpenedError                        Traceback (most recent call last)
    /Users/dhruvkaranmehta/Projects/getaround3/tools/g3/shell.pyc in <module>()
          1 with files.open(writable_file, 'a') as f:
    ----> 2     f.write('[]')
          3
    
    /usr/local/google_appengine/google/appengine/api/files/file.pyc in
    __exit__(self, atype, value, traceback)
        288
        289   def __exit__(self, atype, value, traceback):
    --> 290     self.close()
        291
        292   def write(self, data, sequence_key=None):
    
    /usr/local/google_appengine/google/appengine/api/files/file.pyc in
    close(self, finalize)
        282     request.set_filename(self._filename)
        283     request.set_finalize(finalize)
    --> 284     self._make_rpc_call_with_retry('Close', request, response)
        285
        286   def __enter__(self):
    
    /usr/local/google_appengine/google/appengine/api/files/file.pyc in
    _make_rpc_call_with_retry(self, method, request, response)
        395   def _make_rpc_call_with_retry(self, method, request, response):
        396     try:
    --> 397       _make_call(method, request, response)
        398     except (ApiTemporaryUnavailableError,
    FileTemporaryUnavailableError):
        399
    
    /usr/local/google_appengine/google/appengine/api/files/file.pyc in
    _make_call(method, request, response, deadline)
        243     rpc.check_success()
        244   except apiproxy_errors.ApplicationError, e:
    --> 245     _raise_app_error(e)
        246
        247
    
    /usr/local/google_appengine/google/appengine/api/files/file.pyc in
    _raise_app_error(e)
        186   elif (e.application_error ==
        187         file_service_pb.FileServiceErrors.FILE_NOT_OPENED):
    --> 188     raise FileNotOpenedError()
        189   elif (e.application_error ==
        190         file_service_pb.FileServiceErrors.READ_ONLY):
    
    FileNotOpenedError:

This seems weird since the file was just opened. I have also seen another scenario where opening a file in 'a' mode leads to a `FinalizationError`.

Any additional information will be greatly helpful.

Thanks!
