Explorar el Código

ProgressIndicator: flush the output file or it won't work correctly via ssh

likely due to buffering, the progress indication was not visible.
Thomas Waldmann hace 10 años
padre
commit
f59db03c60
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      borg/helpers.py

+ 2 - 1
borg/helpers.py

@@ -912,7 +912,8 @@ class ProgressIndicatorPercent:
             return self.output(pct)
             return self.output(pct)
 
 
     def output(self, percent):
     def output(self, percent):
-        print(self.msg % percent, file=self.file, end='\r' if self.same_line else '\n')
+        print(self.msg % percent, file=self.file, end='\r' if self.same_line else '\n')  # python 3.3 gives us flush=True
+        self.file.flush()
 
 
     def finish(self):
     def finish(self):
         if self.same_line:
         if self.same_line: