tests: force `dumbhttp.py` to write its log file with '\n' on Windows
This wasn't causing obvious test failures, but it's the same fix as dbd2d56224d1
for `dummysmtpd.py`, and there's no sense in leaving this problem lying around.
(And upon further review, it might have been causing some non-obviously related
failures- see the next commit.)
--- a/tests/dumbhttp.py Sat Oct 26 04:16:00 2024 +0200
+++ b/tests/dumbhttp.py Thu Oct 17 15:21:20 2024 -0400
@@ -5,6 +5,7 @@
Small and dumb HTTP server for use in tests.
"""
+import io
import optparse
import os
import signal
@@ -21,6 +22,20 @@
httpserver = util.httpserver
OptionParser = optparse.OptionParser
+if pycompat.iswindows:
+ sys.stdout = io.TextIOWrapper(
+ sys.stdout.buffer,
+ sys.stdout.encoding,
+ sys.stdout.errors,
+ newline="\n",
+ )
+ sys.stderr = io.TextIOWrapper(
+ sys.stderr.buffer,
+ sys.stderr.encoding,
+ sys.stderr.errors,
+ newline="\n",
+ )
+
if os.environ.get('HGIPV6', '0') == '1':
class simplehttpserver(httpserver.httpserver):