Content-Length: 290281 | pFad | http://github.com/gitpython-developers/GitPython/commit/64fc749e168d16c58d830b9091b7ff3e56857e43

11 apveyor, #519: FIX incomplete Popen pump · gitpython-developers/GitPython@64fc749 · GitHub
Skip to content

Commit 64fc749

Browse files
committed
apveyor, #519: FIX incomplete Popen pump
+ Pump once, so when input larger than `mmap.PAGESIZE`, stream is not emptied.
1 parent d12fdca commit 64fc749

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

git/cmd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ def _parse_lines_from_buffer(buf):
100100
# end
101101

102102
def _read_lines_from_fno(fno, last_buf_list):
103-
buf = os.read(fno, mmap.PAGESIZE)
104-
buf = last_buf_list[0] + buf
103+
for buf in iter(lambda: os.read(fno, mmap.PAGESIZE), b''):
104+
buf = last_buf_list[0] + buf
105105

106-
bi = 0
107-
for bi, line in _parse_lines_from_buffer(buf):
108-
yield line
109-
# for each line to parse from the buffer
106+
bi = 0
107+
for bi, line in _parse_lines_from_buffer(buf):
108+
yield line
109+
# for each line to parse from the buffer
110110

111-
# keep remainder
112-
last_buf_list[0] = buf[bi:]
111+
# keep remainder
112+
last_buf_list[0] = buf[bi:]
113113

114114
def _dispatch_single_line(line, handler):
115115
line = line.decode(defenc)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/gitpython-developers/GitPython/commit/64fc749e168d16c58d830b9091b7ff3e56857e43

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy