You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On that line we base64 encode the content before sticking it in an object that we later serialize to JSON. However, with Python3 that method returns a type of bytes instead of string, and Python JSON serialization does not support the type bytes.
The fix is to convert the response to a string before sticking it in the object. In short, we need to change that line to say
Reproduction steps:
echo "{}" > test.json
gsutil cp test.json gs://<BUCKET>/notebooks/jupyter
Try to open file in either Jupyter or JupyterLab
This looks like a bug in the way we handle files in GCS with a content type other than
test/*
when the contents manager is running in Python3.As a work-around, you can specify a content type of text/plain when uploading the file to GCS, e.g.:
Then the file will open in Jupyter and JupyterLab.
The root cause is this line
On that line we base64 encode the content before sticking it in an object that we later serialize to JSON. However, with Python3 that method returns a type of bytes instead of string, and Python JSON serialization does not support the type bytes.
The fix is to convert the response to a string before sticking it in the object. In short, we need to change that line to say
The text was updated successfully, but these errors were encountered: