[Bug 16970] New: read exactly on newline boundary returns the \r (crlf not being performed)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Jan 17 05:03:52 CST 2009


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 at winehq.org
        ReportedBy: lkcl at 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 at 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 at gonzalez:~/src/python2.5-2.5.2$ more tst <-- faked up to show ^Ms
hell^M
back^M
lkcl at 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'
>>>


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list