• Tim Peters's avatar
    Py_UniversalNewlineFread(): Many changes. · 058b141e
    Tim Peters yazdı
    + Continued looping until n bytes in the buffer have been filled, not
      just when n bytes have been read from the file.  This repairs the
      bug that f.readlines() only sucked up the first 8192 bytes of the file
      on Windows when universal newlines was enabled and f was opened in
      U mode (see Python-Dev -- this was the ultimate cause of the
      test_inspect.py failure).
    
    + Changed prototye to take a char* buffer (void* doesn't make much sense).
    
    + Squashed size_t vs int mismatches (in particular, besides the unsigned
      vs signed distinction, size_t may be larger than int).
    
    + Gets out under all error conditions now (it's possible for fread() to
      suffer an error even if it returns a number larger than 0 -- any
      "short read" is an error or EOF condition).
    
    + Rearranged and simplified declarations.
    058b141e
fileobject.h 2.17 KB