-
-
Notifications
You must be signed in to change notification settings - Fork 934
Failed to read data_stream from a Diff object in python REPL #642
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 for the report, I was able to reproduce the issue. |
I have the same issue, it looks like the same persistent |
The
Which makes for a really awkward interface because it temporally couples the calling code, but at least it gives a hint at how this can be worked around. Maybe the easiest initial fix would be to just make this clear in the documentation somewhere. We've only run into this after upgrading GitPython, so there is an old (maybe really old) version that didn't have this issue. |
Yes, I absolutely agree. It's an implementation detail of the underlying git object database which leaks into the API, and it's a trap that will leave everyone puzzled as to why it happens. Even though I am responsible for this awkwardness and thus should know, it wasn't obvious to me either. Another workaround might be to use the GitDB type when instantiating the git repository, as it is a pure-python implementation that accesses data directly. It's slower, and definitely not suited for server processes due to file handles not being released automatically. Repo('.', odbt=git.db.GitDB) |
Hi, I am using the latest GitPython 3.1.18 and git version 2.30.0 to mine merge scenarios from a repo and still found this error. Here is the code: https://github.com/Symbolk/MergeScenarioMiner/blob/4af16a6bf893301be27a352c24409b3c5612bae0/main.py#L167 I tried the workaround but it did not solve the root cause but reported:
Do you think it is a problem of Git or GitPython? |
It's probably a The only correct implementation is the default one as it uses |
Version: 2.1.5
Python Version: 3.6.0
Reproducing steps:
I have the following python script:
If I save it into
okay.py
and executepython okay.py
, everything's fine.However, if I copy the script and paste it to the python REPL, exception occurs:
Why the inconsistency?
The text was updated successfully, but these errors were encountered: