]> granicus.if.org Git - python/commit
Py_UniversalNewlineFread(): Many changes.
authorTim Peters <tim.peters@gmail.com>
Sun, 21 Apr 2002 07:29:14 +0000 (07:29 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 21 Apr 2002 07:29:14 +0000 (07:29 +0000)
commit058b141ef77edcd8000bc169f3b9b7cc9d362ffa
tree96a5f7b157b28e2667c8ebf708cc3e27d839e645
parentea572b21f846e4b9050a7508c0d5626fc835c309
Py_UniversalNewlineFread():  Many changes.

+ 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.
Include/fileobject.h
Objects/fileobject.c