# HG changeset patch # User Manuel Jacob # Date 1595068555 -7200 # Node ID ed58ecd5903033991e7fcbf560e83f7478acf08d # Parent 74b486226480fedb1d78eb44566c8733bb6c38c4 windows: don’t set `softspace` attribute in `winstdout` Python 2 file objects have the `softspace` attribute (https://docs.python.org/2/library/stdtypes.html#file.softspace), which is used by the print statement to track its internal state. The documentation demands from file-like objects only that the attribute is writable and initialized to 0. Method `file.write()` sets it to 0, but this is not documented. Historically, sys.stdout was replaced by an instance of the `winstdout` class, so it needed to behave exactly the same (the softspace fix was introduced in 705278e70457). Nowadays we don’t replace sys.stdout and don’t use the print statement on `winstdout` instances, so we can safely drop it. diff -r 74b486226480 -r ed58ecd59030 mercurial/windows.py --- a/mercurial/windows.py Fri Jul 17 14:58:22 2020 +0200 +++ b/mercurial/windows.py Sat Jul 18 12:35:55 2020 +0200 @@ -217,8 +217,6 @@ pass def write(self, s): - if not pycompat.ispy3: - self.softspace = 0 try: if not self.throttle: return self.fp.write(s)