Patchwork D8342: tests: prevent printing \r to stdout

login
register
mail settings
Submitter phabricator
Date April 1, 2020, 7:09 p.m.
Message ID <8887641bb68216088c461d30988f0a67@localhost.localdomain>
Download mbox | patch
Permalink /patch/45983/
State Not Applicable
Headers show

Comments

phabricator - April 1, 2020, 7:09 p.m.
Closed by commit rHG47e6ec977555: tests: prevent printing \r to stdout (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8342?vs=20915&id=20952

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8342/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8342

AFFECTED FILES
  tests/test-notify.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-notify.t b/tests/test-notify.t
--- a/tests/test-notify.t
+++ b/tests/test-notify.t
@@ -1,7 +1,16 @@ 
   $ cat > $TESTTMP/filter.py <<EOF
   > from __future__ import absolute_import, print_function
+  > import io
   > import re
   > import sys
+  > if sys.version_info[0] >= 3:
+  >     sys.stdout = io.TextIOWrapper(
+  >         sys.stdout.buffer,
+  >         sys.stdout.encoding,
+  >         sys.stdout.errors,
+  >         newline="\n",
+  >         line_buffering=sys.stdout.line_buffering,
+  >     )
   > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
   > EOF