D2306: tests: fix get-with-headers.py on python3 when writing to stdout

2018-02-18 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc95c8ab2e7ec: tests: fix get-with-headers.py on python3 
when writing to stdout (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2306?vs=5824=5843

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

AFFECTED FILES
  tests/get-with-headers.py

CHANGE DETAILS

diff --git a/tests/get-with-headers.py b/tests/get-with-headers.py
--- a/tests/get-with-headers.py
+++ b/tests/get-with-headers.py
@@ -76,7 +76,7 @@
 if args.bodyfile:
 bodyfh = open(args.bodyfile, 'wb')
 else:
-bodyfh = sys.stdout
+bodyfh = getattr(sys.stdout, 'buffer', sys.stdout)
 
 # Pretty print JSON. This also has the beneficial side-effect
 # of verifying emitted JSON is well-formed.



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2306: tests: fix get-with-headers.py on python3 when writing to stdout

2018-02-17 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/get-with-headers.py

CHANGE DETAILS

diff --git a/tests/get-with-headers.py b/tests/get-with-headers.py
--- a/tests/get-with-headers.py
+++ b/tests/get-with-headers.py
@@ -76,7 +76,7 @@
 if args.bodyfile:
 bodyfh = open(args.bodyfile, 'wb')
 else:
-bodyfh = sys.stdout
+bodyfh = getattr(sys.stdout, 'buffer', sys.stdout)
 
 # Pretty print JSON. This also has the beneficial side-effect
 # of verifying emitted JSON is well-formed.



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel