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:
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 populatemodel["format"]
correctly for these files. This propagates through_get_file()
andget()
, such that whensave()
and_save_file()
is called the incorrect defaulttext
format is getting passed through tofs.write()
.The changes I made broadly follow the
notebook
base implementation, see: