-
Notifications
You must be signed in to change notification settings - Fork 66
stream.read(8192) on image heavy repository returns 0 despite having more data #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks a lot of the detailed description of what's going on - it's a pleasure to read! Unless you have a specific requirement for using the I hope that helps! |
Thanks for the fast response. The which doesn't look like it's slurping in the complete file before returning anything to the caller. Am I missing something? |
I think that note can safely be ignored, unless you find yourself actually running out of memory. Maybe I wrote this because I found a long-running |
Thanks. Closing for now. |
I'm using gitdb in combination with GitPython to handle files directly from git repositories. So far this worked perfectly. Thanks!
Something odd is happening in a repository I'm handling at the moment. I've traced it down to the
read
function within theDecompressMemMapReader
. More precisely this line of code:gitdb/gitdb/stream.py
Line 275 in 90c4f25
If I understand things correctly, this check tries to enlarge the input buffer (containing compressed data) to at least 8 bytes, so the following
self._zip.decompress
call returns at last some data.In my repository this doesn't help:
len(dcompdat)
is0
and all the way back in my code, aread(8192)
returns''
despite more data being available. Changing8192
to8191
(or other random values) most of the time "fixes" this. I suspect this is the result of different internal buffering.Not sure if it helps with finding a reason why
decompress
doesn't return anything from 8 input bytes, but the file responsible is an already compressed JPEG file.How to fix this? Changing the minimum window size to 48 seems to help
but I'm not sure if this has consequences I don't fully understand. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: