D8346: tests: force newlines to LF in tinyproxy.py

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

D8346: tests: force newlines to LF in tinyproxy.py

pulkit (Pulkit Goyal)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Yet another instance where we need to replace the sys.std* streams
  to prevent CRLF from creeping in on Windows.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/tinyproxy.py

CHANGE DETAILS

diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py
--- a/tests/tinyproxy.py
+++ b/tests/tinyproxy.py
@@ -14,6 +14,7 @@
 
 __version__ = "0.2.1"
 
+import io
 import optparse
 import os
 import select
@@ -25,6 +26,23 @@
     util,
 )
 
+# Ensure Windows doesn't emit CRLF.
+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,
+    )
+    sys.stderr = io.TextIOWrapper(
+        sys.stderr.buffer,
+        sys.stderr.encoding,
+        sys.stderr.errors,
+        newline="\n",
+        line_buffering=sys.stderr.line_buffering,
+    )
+
 httpserver = util.httpserver
 socketserver = util.socketserver
 urlreq = util.urlreq



To: indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8346: tests: force newlines to LF in tinyproxy.py

pulkit (Pulkit Goyal)
marmoute added a comment.
marmoute accepted this revision.


  looks legit

REPOSITORY
  rHG Mercurial

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

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

To: indygreg, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8346: tests: force newlines to LF in tinyproxy.py

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
marmoute added a comment.
marmoute added a subscriber: mharbison72.
marmoute resigned from this revision.


  actually @mharbison72  comment on D8345 <https://phab.mercurial-scm.org/D8345> make me reconsider. Please allign the status of this with the status of D8345 <https://phab.mercurial-scm.org/D8345>.

REPOSITORY
  rHG Mercurial

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

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

To: indygreg, #hg-reviewers
Cc: mharbison72, marmoute, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8346: tests: force newlines to LF in tinyproxy.py

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
Herald added a subscriber: mercurial-patches.
This revision now requires changes to proceed.
baymax added a comment.
baymax requested changes to this revision.


  There seems to have been no activities on this Diff for the past 3 Months.
 
  By policy, we are automatically moving it out of the `need-review` state.
 
  Please, move it back to `need-review` without hesitation if this diff should still be discussed.
 
  :baymax:need-review-idle:

REPOSITORY
  rHG Mercurial

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

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

To: indygreg, #hg-reviewers, marmoute, baymax
Cc: mercurial-patches, mharbison72, marmoute, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel