Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b1249e

Browse files
committed
apveyor,#519: FIX incomplete Popen pump
+ Pump once, so when input larger than `mmap.PAGESIZE`, stream is notemptied.
1 parentd12fdca commit4b1249e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

‎git/cmd.py

Lines changed: 9 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+
forbufiniter(lambda:os.read(fno,mmap.PAGESIZE),b''):
104+
buf=last_buf_list[0]+buf
105105

106-
bi=0
107-
forbi,linein_parse_lines_from_buffer(buf):
108-
yieldline
109-
# for each line to parse from the buffer
106+
bi=0
107+
forbi,linein_parse_lines_from_buffer(buf):
108+
yieldline
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)
@@ -199,6 +199,7 @@ def _deplete_buffer(fno, handler, buf_list, wg=None):
199199
forfno, (handler,buf_list)infdmap.items():
200200
wg.add(1)
201201
t=threading.Thread(target=lambda:_deplete_buffer(fno,handler,buf_list,wg))
202+
t.setDaemon(True)
202203
t.start()
203204
# end
204205
# NOTE: Just joining threads can possibly fail as there is a gap between .start() and when it's

‎git/test/test_git.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ def counter_stderr(line):
238238
stdin=None,
239239
stdout=subprocess.PIPE,
240240
stderr=subprocess.PIPE,
241-
shell=False)
241+
shell=False,
242+
creationflags=Git.CREATE_NO_WINDOWifsys.platform=='win32'else0,
243+
)
242244

243245
handle_process_output(proc,counter_stdout,counter_stderr,lambdaproc:proc.wait())
244246

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp