@@ -523,7 +523,9 @@ def _get_fetch_info_from_stderr(self, proc, progress):
523523
524524 progress_handler = progress .new_message_handler ()
525525
526- def my_progress_handler (line ):
526+ for line in proc .stderr :
527+ line = line .decode (defenc )
528+ line = line .rstrip ()
527529 for pline in progress_handler (line ):
528530 if line .startswith ('fatal:' ):
529531 raise GitCommandError (("Error when fetching: %s" % line ,), 2 )
@@ -538,7 +540,7 @@ def my_progress_handler(line):
538540 # end
539541
540542 # We are only interested in stderr here ...
541- handle_process_output (proc , None , my_progress_handler , finalize_process )
543+ finalize_process (proc )
542544
543545 # read head information
544546 fp = open (join (self .repo .git_dir , 'FETCH_HEAD' ), 'rb' )
@@ -608,6 +610,7 @@ def fetch(self, refspec=None, progress=None, **kwargs):
608610 args = [refspec ]
609611
610612 proc = self .repo .git .fetch (self , * args , with_extended_output = True , as_process = True , v = True , ** kwargs )
613+ proc .stdout .close ()
611614 res = self ._get_fetch_info_from_stderr (proc , progress or RemoteProgress ())
612615 if hasattr (self .repo .odb , 'update_cache' ):
613616 self .repo .odb .update_cache ()
@@ -623,6 +626,7 @@ def pull(self, refspec=None, progress=None, **kwargs):
623626 :return: Please see 'fetch' method """
624627 kwargs = add_progress (kwargs , self .repo .git , progress )
625628 proc = self .repo .git .pull (self , refspec , with_extended_output = True , as_process = True , v = True , ** kwargs )
629+ proc .stdout .close ()
626630 res = self ._get_fetch_info_from_stderr (proc , progress or RemoteProgress ())
627631 if hasattr (self .repo .odb , 'update_cache' ):
628632 self .repo .odb .update_cache ()
0 commit comments