[x] I am confident this is a bug in CPython, not a bug in a third-party project
[X] I have searched the CPython issue tracker,
and am confident this bug has not been reported before
CPython versions tested on:
3.8
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
No response
A clear and concise description of the bug:
import sys, codecs
a = codecs.getwriter('cp850')
b = a(sys.stdout.buffer)
c = a(sys.stdout)
b.write('A')
c.write('A') # error!
Now that b is enough to write text in cp850, why can one construct a werid and buggy c?
Then, why does codecs.StreamWriter accept text data stream such as sys.stdout?
Bug report
Checklist
CPython versions tested on:
3.8
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
No response
A clear and concise description of the bug:
Now that b is enough to write text in cp850, why can one construct a werid and buggy c? Then, why does codecs.StreamWriter accept text data stream such as sys.stdout?