The TextFileContentsManager does not allow large file uploads via the UI (resulting in corrupted files). The reason is that it only extends from the FileContentsManager instead of the LargeFileManager which is used as default file manager in Jupyter.
class TextFileContentsManager(FileContentsManager, Configurable)
It would be great if the TextFileContentsManager would extend from the LargeFileManager instead of FileContentsManager to support large file uploads.
I see! Thanks for pointing this out. We'll see what we can do.
To start with I have a few questions: Is this upload functionality available in Jupyter Lab only? How large the file should be to reproduce the issue? And, by chance, did you try already to substitute FileContentsManager with LargeFileManager?
Is this upload functionality available in Jupyter Lab only?
The upload functionality is available in Jupyter as well as Jupyter Lab. Both seem not to be able to correctly upload large files.


Btw. I'm running JupyterLab 0.35.4 and Jupyter 5.7.6.
How large the file should be to reproduce the issue?
I already get corrupted files with 50 MB uploads. The file on Jupyter will only have a few KB. Files with a few MB work fine.
Did you try already to substitute FileContentsManager with LargeFileManager?
I haven't tried to replace it in the TextFileContentsManager, but might try this in the next days. Since LargeFileManager is the default setting for Jupyter as you can see here and uploading large files worked before I installed Jupytext, I assume that this would solve the issue.

Thanks @LukasMasuch . I was able to reproduce the issue. I think your recommendation does work (at least, all the tests pass). I have prepared a new version with the fix, but I prefer that we both test it before I publish it globally: do you want to give a try at version 1.0.6 on test.pypi.org ?
pip install -i https://test.pypi.org/simple/ jupytext
Thanks for the quick-fix! Uploads of large files are working for me with this version. I also tested a few interactions with Jupytext and everything seems to still work fine for me.
Most helpful comment
Thanks @LukasMasuch . I was able to reproduce the issue. I think your recommendation does work (at least, all the tests pass). I have prepared a new version with the fix, but I prefer that we both test it before I publish it globally: do you want to give a try at version 1.0.6 on test.pypi.org ?