danielfrg / s3contents

Jupyter Notebooks in S3 - Jupyter Contents Manager implementation
Apache License 2.0
248 stars 88 forks source link

Fix file format #87

Closed zac-yang closed 4 years ago

zac-yang commented 4 years ago

Hey @danielfrg, I discovered an issue when copy/pasting binary files with s3contents, where the new file ends up being corrupted. Seems like the root cause is that GenericContentsManager._file_model_from_path() does not populate model["format"] correctly for these files. This propagates through _get_file() and get(), such that when save() and _save_file() is called the incorrect default text format is getting passed through to fs.write().

The changes I made broadly follow the notebook base implementation, see:

danielfrg commented 4 years ago

Thanks! I will do a small release today if i get some free time.