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
This commit is contained in:
Victor Stinner 2010-05-25 21:12:34 +00:00
parent 0b2f5180d7
commit 479736b31c
3 changed files with 40 additions and 2 deletions

View file

@ -383,9 +383,9 @@ def main():
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():