Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer and
sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes API
diff --git a/Lib/base64.py b/Lib/base64.py
index a8d9f21..20ed67d 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -383,9 +383,9 @@
if o == '-u': func = decode
if o == '-t': test(); return
if args and args[0] != '-':
- func(open(args[0], 'rb'), sys.stdout)
+ func(open(args[0], 'rb'), sys.stdout.buffer)
else:
- func(sys.stdin, sys.stdout)
+ func(sys.stdin.buffer, sys.stdout.buffer)
def test():