Commit Graph

9 Commits

Author SHA1 Message Date
Benjamin Peterson ddd392cbb9 accept None as the same as having passed no argument in file types #7349
This is for consistency with imitation file objects like StringIO and BytesIO.

This commit also adds a few tests, where they were lacking for concerned
methods.
2009-12-13 19:19:07 +00:00
Mark Dickinson 889d96455a Issue #7228: Fix format mismatch when printing something of type off_t.
(Should silence some compiler warnings.)
2009-11-24 20:51:48 +00:00
Antoine Pitrou e50efaad9f Buffered I/O: optimize lock taking in the common non-contended case. 2009-11-01 11:58:22 +00:00
Mark Dickinson 3ddb52717f Roll back ill-considered attempts to fix printf specifier mismatch for off_t.
The sensible solution seems to be to implement %lld for PyString_FromFormat(V)
and PyErr_Format.  See issue #7228.
2009-10-29 09:46:04 +00:00
Mark Dickinson bf1039d98c Silence gcc warnings when trying to print an off_t using "lld", on platforms
where off_t has type long (e.g., 64-bit Linux).
2009-10-27 21:48:20 +00:00
Mark Dickinson e052b64def Use correct conversion specifier and length modifier when printing an
integer of type off_t.  Also, don't assume that long long is available.
2009-10-26 19:59:23 +00:00
Amaury Forgeot d'Arc 3de4647022 Fix compilation warning on Windows, where size_t is 32bit but file offsets are 64bit. 2009-10-05 20:18:05 +00:00
Antoine Pitrou 20e1f932fa Issue #6629: Fix a data corruption issue in the new `io` package, which could
occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
"wb+" mode) after having buffered a certain amount of data for reading. This
bug was not present in the pure Python implementation.

Yes, this is a serious issue.
2009-08-06 20:18:29 +00:00
Antoine Pitrou 1969059327 Issue #6215: backport the 3.1 io lib 2009-06-12 20:14:08 +00:00