tests: force `dummysmtpd.py` to write its log file with '\n' on Windows
The log files were being `cat'd` in `test-patchbomb-tls.t`, and causing
gratuitous failures. Since `sys.stdout` is being written to with `str` instead
of `bytes`, use a `io.TextIOWrapper` to change the EOL, like 2924676d4728.
--- a/tests/dummysmtpd.py Mon Oct 14 20:11:27 2024 -0400
+++ b/tests/dummysmtpd.py Tue Oct 15 18:35:45 2024 -0400
@@ -3,6 +3,7 @@
"""dummy SMTP server for use in tests"""
+import io
import optparse
import os
import socket
@@ -16,6 +17,13 @@
ui as uimod,
)
+if pycompat.iswindows:
+ sys.stdout = io.TextIOWrapper(
+ sys.stdout.buffer,
+ sys.stdout.encoding,
+ sys.stdout.errors,
+ newline="\n",
+ )
if os.environ.get('HGIPV6', '0') == '1':
family = socket.AF_INET6