By removing the content_type argument <https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/functions#open>, Cloud Storage defaults to the type binary/octet-stream when it serves the object.
In regards to Python 3.7, as per the documents [1] <https://cloud.google.com/appengine/docs/standard/python3/using-cloud-storage> [2] <https://cloud.google.com/storage/docs/reference/libraries#installing_the_client_library> the Cloud Storage library is supported. However, I could not find how to zip multiple file in the documents. I suggest you take a look here <https://cloud.google.com/storage/docs/uploading-objects> and/or open a thread on Stack Overflow where other developers could provide some strategies on how to accomplish that. On Thursday, July 4, 2019 at 7:58:03 PM UTC-4, Kyle Chessman wrote: > > I fixed this issue by removing the content_type argument in the open call. > I'm not sure if this could cause any side effects but our task queue for > zipping files cleared up with no problems. > > We want to migrate to Python 3 in the future but the App Engine Cloud > Storage library doesn't support Python 3 nor does it seem like it ever will > ( https://github.com/GoogleCloudPlatform/appengine-gcs-client/issues/78 ). > I wonder if zipping multiple files like this is still possible using the > newer google-cloud-storage library. > > On Thursday, 4 July 2019 17:18:14 UTC-4, Kyle Chessman wrote: >> >> I've been having the same problem since June 28. All other GCS operations >> have been continuing just fine. >> >> On Thursday, 27 June 2019 22:59:09 UTC-4, Friso Kluit wrote: >>> >>> Using App Engine Python 2.7 Standard >>> >>> Since about two hours, my operation to create a zip file on GCS is >>> failing. Before this, it was working fine. >>> The following line >>> >>> import cloudstorage as gcs >>> ... >>> with gcs.open(new_zf.gcs_filename, 'w', content_type=b'multipart/x-zip', >>> options={b'x-goog-acl': b'public-read', >>> b'cache-control': b'private, max-age=0, no-cache'}) as nzf: >>> >>> triggers this error >>> >>> <Error><Code>InvalidAuthentication</Code><Message>The provided >>> authentication header is invalid.</Message><Details>Cannot use OAuth >>> Authorization header with form POST.</Details></Error>". Extra info: None. >>> >>> I have tried to change permissions on my roles on GCS from Storage >>> Legacy Owner to Storage Admin >>> >>> but I get a 'Sorry, there’s a problem. If you entered information, >>> check it and try again. Otherwise, the problem might clear up on its own, >>> so check back later.' error >>> >> -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/660953b6-03b8-464a-82c4-23f5e33f7013%40googlegroups.com.
