<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Include/fileobject.h, branch v2.3.6</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>Patch #788249: Pass an explicit buffer to setvbuf in PyFile_SetBufSize().</title>
<updated>2003-09-04T19:02:20+00:00</updated>
<author>
<name>Martin v. Löwis</name>
<email>martin@v.loewis.de</email>
</author>
<published>2003-09-04T19:02:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=41add1706d2c41ad0b41b689dc40322b042e1a4c'/>
<id>41add1706d2c41ad0b41b689dc40322b042e1a4c</id>
<content type='text'>
Fixes #603724.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #603724.
</pre>
</div>
</content>
</entry>
<entry>
<title>Patch #612627: Add encoding attribute to file objects, and determine</title>
<updated>2003-05-10T07:10:12+00:00</updated>
<author>
<name>Martin v. Löwis</name>
<email>martin@v.loewis.de</email>
</author>
<published>2003-05-10T07:10:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=5467d4c0e31e9db305a4899a44d7978f83e96649'/>
<id>5467d4c0e31e9db305a4899a44d7978f83e96649</id>
<content type='text'>
the terminal encoding on Windows and Unix.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the terminal encoding on Windows and Unix.
</pre>
</div>
</content>
</entry>
<entry>
<title>Excise DL_EXPORT from Include.</title>
<updated>2002-08-12T07:21:58+00:00</updated>
<author>
<name>Mark Hammond</name>
<email>mhammond@skippinet.com.au</email>
</author>
<published>2002-08-12T07:21:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=91a681debf9ffec155d0aff8a0bb5f965f592e16'/>
<id>91a681debf9ffec155d0aff8a0bb5f965f592e16</id>
<content type='text'>
Thanks to Skip Montanaro and Kalle Svensson for the patches.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to Skip Montanaro and Kalle Svensson for the patches.
</pre>
</div>
</content>
</entry>
<entry>
<title>SF patch 580331 by Oren Tirosh: make file objects their own iterator.</title>
<updated>2002-08-06T15:55:28+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2002-08-06T15:55:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7a6e95948cd2e163c066943f755d85007c306047'/>
<id>7a6e95948cd2e163c066943f755d85007c306047</id>
<content type='text'>
For a file f, iter(f) now returns f (unless f is closed), and f.next()
is similar to f.readline() when EOF is not reached; however, f.next()
uses a readahead buffer that messes up the file position, so mixing
f.next() and f.readline() (or other methods) doesn't work right.
Calling f.seek() drops the readahead buffer, but other operations
don't.

The real purpose of this change is to reduce the confusion between
objects and their iterators.  By making a file its own iterator, it's
made clearer that using the iterator modifies the file object's state
(in particular the current position).

A nice side effect is that this speeds up "for line in f:" by not
having to use the xreadlines module.  The f.xreadlines() method is
still supported for backwards compatibility, though it is the same as
iter(f) now.

(I made some cosmetic changes to Oren's code, and added a test for
"file closed" to file_iternext() and file_iter().)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For a file f, iter(f) now returns f (unless f is closed), and f.next()
is similar to f.readline() when EOF is not reached; however, f.next()
uses a readahead buffer that messes up the file position, so mixing
f.next() and f.readline() (or other methods) doesn't work right.
Calling f.seek() drops the readahead buffer, but other operations
don't.

The real purpose of this change is to reduce the confusion between
objects and their iterators.  By making a file its own iterator, it's
made clearer that using the iterator modifies the file object's state
(in particular the current position).

A nice side effect is that this speeds up "for line in f:" by not
having to use the xreadlines module.  The f.xreadlines() method is
still supported for backwards compatibility, though it is the same as
iter(f) now.

(I made some cosmetic changes to Oren's code, and added a test for
"file closed" to file_iternext() and file_iter().)
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing \ to macro definition only used when universal newlines</title>
<updated>2002-05-24T15:24:38+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2002-05-24T15:24:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a0a6c5a042818461fa199c8a3daefb7fd00ffe1b'/>
<id>a0a6c5a042818461fa199c8a3daefb7fd00ffe1b</id>
<content type='text'>
are disabled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
are disabled.
</pre>
</div>
</content>
</entry>
<entry>
<title>Py_UniversalNewlineFread():  Many changes.</title>
<updated>2002-04-21T07:29:14+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2002-04-21T07:29:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=058b141ef77edcd8000bc169f3b9b7cc9d362ffa'/>
<id>058b141ef77edcd8000bc169f3b9b7cc9d362ffa</id>
<content type='text'>
+ 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
+ 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mass checkin of universal newline support.</title>
<updated>2002-04-14T20:12:41+00:00</updated>
<author>
<name>Jack Jansen</name>
<email>jack.jansen@cwi.nl</email>
</author>
<published>2002-04-14T20:12:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7b8c7546ebc1fc3688ef95768fa8b82f0f205490'/>
<id>7b8c7546ebc1fc3688ef95768fa8b82f0f205490</id>
<content type='text'>
Highlights: import and friends will understand any of \r, \n and \r\n
as end of line. Python file input will do the same if you use mode 'U'.
Everything can be disabled by configuring with --without-universal-newlines.

See PEP278 for details.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Highlights: import and friends will understand any of \r, \n and \r\n
as end of line. Python file input will do the same if you use mode 'U'.
Everything can be disabled by configuring with --without-universal-newlines.

See PEP278 for details.
</pre>
</div>
</content>
</entry>
<entry>
<title>Patch #530105: Allow file object may to be subtyped</title>
<updated>2002-03-15T17:42:16+00:00</updated>
<author>
<name>Martin v. Löwis</name>
<email>martin@v.loewis.de</email>
</author>
<published>2002-03-15T17:42:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=f6eebbb4358d8749d5800814bab8c4cf3f068fbc'/>
<id>f6eebbb4358d8749d5800814bab8c4cf3f068fbc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>PyFile_WriteString():  change prototype so that the string arg is</title>
<updated>2001-11-28T22:13:25+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-11-28T22:13:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c1bbcb87aa8b576c8934aed6555681a62c820c25'/>
<id>c1bbcb87aa8b576c8934aed6555681a62c820c25</id>
<content type='text'>
const char* instead of char*.  The change is conceptually correct, and
indirectly fixes a compiler wng introduced when somebody else innocently
passed a const char* to this function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
const char* instead of char*.  The change is conceptually correct, and
indirectly fixes a compiler wng introduced when somebody else innocently
passed a const char* to this function.
</pre>
</div>
</content>
</entry>
<entry>
<title>SF bug [#460467] file objects should be subclassable.</title>
<updated>2001-09-13T05:38:56+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-13T05:38:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=59c9a645e2f44b0b546225678d704787d9eae35d'/>
<id>59c9a645e2f44b0b546225678d704787d9eae35d</id>
<content type='text'>
Preliminary support.  What's here works, but needs fine-tuning.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Preliminary support.  What's here works, but needs fine-tuning.
</pre>
</div>
</content>
</entry>
</feed>
