eryksun added the comment: AFAIK, this doesn't affect Python 3 under normal circumstances. A file could be manually set to text mode by calling msvcrt.setmode(f.fileno(), os.O_TEXT), but that's out of the norm.
In Python 2, on Windows interpreting ctrl+z (0x1a) as end-of-file is normal behavior in text mode. Read the remarks about [t]ext mode in the description of Microsoft's fopen implementation: http://msdn.microsoft.com/en-us/library/yeby3zcb%28v=vs.90%29.aspx If you use Python's universal newlines mode, e.g. open('sample.txt', 'rU'), then the underlying file is opened in binary mode and therefore will not interpret ctrl+z as the end-of-file marker. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21104> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com