diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-11-22 00:41:45 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-11-22 00:41:45 (GMT) |
commit | 44309e6b3768d6d559491ddf6ca56bfad2adb9b5 (patch) | |
tree | 5d71526f8d1b06a39c67191bf55e85e68c205c95 /Lib/socket.py | |
parent | 656aa28cd50d00171d46df30eaeecd45eb0ae32c (diff) | |
download | cpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.zip cpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.tar.gz cpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.tar.bz2 |
make FileIO.mode always include 'b'
#4386 Reviewed by Amaury
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 5578b13..045987c 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -198,10 +198,12 @@ class SocketIO(io.RawIOBase): # XXX More docs def __init__(self, sock, mode): - if mode not in ("r", "w", "rw"): + if mode not in ("r", "w", "rw", "rb", "wb", "rwb"): raise ValueError("invalid mode: %r" % mode) io.RawIOBase.__init__(self) self._sock = sock + if "b" not in mode: + mode += "b" self._mode = mode self._reading = "r" in mode self._writing = "w" in mode |