Inconsistent results when streaming to unidiff (does not happen with urlopen or requests) #3736
Unanswered
AdamWill
asked this question in
Potential Issue
Replies: 1 comment
-
|
This is with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In an LLM code review project we've been looking at different ways of parsing diffs. Today I was looking at different ways of reading diffs from a forge (GitHub, GitLab etc.) into unidiff, a diff parser. I encountered some weird behavior which I first reported to unidiff but now think is probably an httpx issue.
Here's the reproducer:
as you can see, that implements various ways of getting the same diff file, feeding it to
unidiff, and checking that it generates the expected result.If you run the 50-iteration loop for
naive,sophisticated_requests, orsophisticated_urlopen, they pass: they print OK 50 times. If you run it forsophisticated_httpx, it will produce some OKs but also fail in various interesting ways, documented in detail in the issue I reported to unidiff - it either misses some content, or crashes.All three 'sophisticated' methods use the same amount of memory, indicating they all are actually streaming the content to unidiff. But urlopen and requests work reliably, while httpx doesn't. I'm not sure why this is.
Beta Was this translation helpful? Give feedback.
All reactions