mirror of
https://github.com/python/cpython.git
synced 2025-10-20 13:43:01 +00:00
This commit is contained in:
commit
d9fc85db7f
2 changed files with 11 additions and 1 deletions
|
@ -10,6 +10,8 @@ What's New in Python 3.3 Alpha 1?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.
|
||||||
|
|
||||||
- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
|
- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
|
||||||
a new HAVE_MBCS define.
|
a new HAVE_MBCS define.
|
||||||
|
|
||||||
|
@ -1327,7 +1329,7 @@ Core and Builtins
|
||||||
(length bigger than 2^31-1 bytes).
|
(length bigger than 2^31-1 bytes).
|
||||||
|
|
||||||
- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
|
- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
|
||||||
stdprinter.write() clamp the length to 2^31-1 on Windows.
|
stdprinter.write() clamp the length to INT_MAX on Windows.
|
||||||
|
|
||||||
- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
|
- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
|
||||||
can now handle dates after 2038.
|
can now handle dates after 2038.
|
||||||
|
|
|
@ -687,6 +687,10 @@ fileio_read(fileio *self, PyObject *args)
|
||||||
return fileio_readall(self);
|
return fileio_readall(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MS_WIN64) || defined(MS_WINDOWS)
|
||||||
|
if (size > INT_MAX)
|
||||||
|
size = INT_MAX;
|
||||||
|
#endif
|
||||||
bytes = PyBytes_FromStringAndSize(NULL, size);
|
bytes = PyBytes_FromStringAndSize(NULL, size);
|
||||||
if (bytes == NULL)
|
if (bytes == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -695,7 +699,11 @@ fileio_read(fileio *self, PyObject *args)
|
||||||
if (_PyVerify_fd(self->fd)) {
|
if (_PyVerify_fd(self->fd)) {
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
#if defined(MS_WIN64) || defined(MS_WINDOWS)
|
||||||
|
n = read(self->fd, ptr, (int)size);
|
||||||
|
#else
|
||||||
n = read(self->fd, ptr, size);
|
n = read(self->fd, ptr, size);
|
||||||
|
#endif
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
} else
|
} else
|
||||||
n = -1;
|
n = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue