# HG changeset patch # User Anton Shestakov # Date 1673556997 -14400 # Node ID 8f9fbc665928dd2f155081f202cf248cfba8f9de # Parent 9282930f8b52d14acbf1ca4835d30c25beb23363 convert: change socket mode from b'r+' to 'rwb' in cvs.py (issue6789) 'r+' mode used to open sockets for read/write operations, but '+' is not supported in Python 3. We're using bytes with these sockets everywhere, so the mode should have 'b'. But the mode argument has to be str, not bytes. diff -r 9282930f8b52 -r 8f9fbc665928 hgext/convert/cvs.py --- a/hgext/convert/cvs.py Thu Jan 12 19:59:01 2023 +0400 +++ b/hgext/convert/cvs.py Fri Jan 13 00:56:37 2023 +0400 @@ -199,7 +199,7 @@ if sck.recv(128) != b"I LOVE YOU\n": raise error.Abort(_(b"CVS pserver authentication failed")) - self.writep = self.readp = sck.makefile(b'r+') + self.writep = self.readp = sck.makefile('rwb') if not conntype and root.startswith(b":local:"): conntype = b"local"