diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 21510441..2b2e4763 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -381,7 +381,8 @@ class Up2k(object): self.pp.msg = "a{} {}".format(self.pp.n, cdir) histdir = os.path.join(top, ".hist") ret = 0 - for iname, inf in statdir(self.log, not self.args.no_scandir, False, cdir): + g = statdir(self.log, not self.args.no_scandir, False, cdir) + for iname, inf in sorted(g): abspath = os.path.join(cdir, iname) lmod = int(inf.st_mtime) if stat.S_ISDIR(inf.st_mode): diff --git a/copyparty/util.py b/copyparty/util.py index 1e58f273..2ab3020c 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -208,6 +208,8 @@ class ProgressPrinter(threading.Thread): msg = self.msg uprint(" {}\033[K\r".format(msg)) + if PY2: + sys.stdout.flush() print("\033[K", end="") sys.stdout.flush() # necessary on win10 even w/ stderr btw