◐ Shell
clean mode source ↗

Issue 14253: print() encodes characters to native system encoding

I'm on a cp932-encoded system. When I read in a cp1252-file, it's read into memory properly, but when printing it, Python tries to encode the output to cp932. Here's the relevant code:

address = "C:/Path/to/file/file.ext"
with open(address, encoding="cp1252") as alpha:
  print(line, end="")

Traceback (most recent call last):
 File "C:\Python32\parser.py",
line 8, in <module>
   print(line)
UnicodeEncodeError: 'cp932' codec can't encode character '\xe9' in
position 13: illegal multibyte sequence

Shouldn't the output be in unicode?