diff -r 7cfbebadb90b Lib/socket.py --- a/Lib/socket.py Tue Feb 11 08:13:10 2014 -0500 +++ b/Lib/socket.py Tue Feb 11 22:35:39 2014 +0100 @@ -200,7 +200,7 @@ """ for c in mode: if c not in {"r", "w", "b"}: - raise ValueError("invalid mode %r (only r, w, b allowed)") + raise ValueError("invalid mode %r (only r, w, b allowed)" % c) writing = "w" in mode reading = "r" in mode or not writing assert reading or writing