mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
0b2f5180d7
commit
479736b31c
3 changed files with 40 additions and 2 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue