Open scamille opened 1 year ago
I don't know why the fix was reverted in this pull, but the code here solved my similar issue.
I'm sorry, it wasn't reverted but it hasn't been merged either. That's because the fix causes tests to fail. I was working on a variation of the fix in #94 that does not break any existing functionality, but I ran into a dead end because I wasn't able to reproduce the large file problem reliably on my system.
I recently ran into a issue when formatting a large C++ file. The error message that always came up was
error: unable to read file content from object database:
coming from hereAfter investigating the issues further, I stumbled upon the python documentation for subprocess
Popen.wait
(https://docs.python.org/3/library/subprocess.html#subprocess.Popen.wait) which states thatwait()
will deadlock under certain circumstances when using pipes, which I assume happendes here.Changing the implementation of the
format_object
function to the following resolved the issue for me:I am not 100% sure if that solution is correct. It is mostly based on https://stackoverflow.com/a/34166541