http://bugs.winehq.org/show_bug.cgi?id=16970
Summary: read exactly on newline boundary returns the \r (crlf not being performed) Product: Wine Version: unspecified Platform: All OS/Version: All Status: UNCONFIRMED Severity: major Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: lkcl@lkcl.net
this test demonstrates that msvcrt read, on a newline boundary, fails to have the crlf converted to lf.
expected results (as confirmed from using msvcrt.dll "native"): f.readline(5) should equal "hell\n" and instead it is returning "hell\r".
this simple boundary-case is responsible for virtually every single one of the remaining python/wine regression test failures!
this should be very easy to replicate in c-code.
lkcl@gonzalez:~/src/python2.5-2.5.2$ ./python.exe Python 2.5.2 (r252:60911, Jan 16 2009, 22:06:34) [gcc-mingw32] on win32 Type "help", "copyright", "credits" or "license" for more information.
f = open("tst", "w") f.write("hell\n") f.write("back\n") f.close()
lkcl@gonzalez:~/src/python2.5-2.5.2$ more tst <-- faked up to show ^Ms hell^M back^M lkcl@gonzalez:~/src/python2.5-2.5.2$ % ./python.exe f = open("tst", "r")
x = f.readline(5) x
'hell\r' <------- wrongggggg
f.seek(0) f.readline()
'hell\n' <-------- ah _ha_. if you don't specify the length to be read....
f.seek(0) f.readline(4)
'hell'
f.readline()
'\n'