Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dc555400
Commit
dc555400
authored
Jan 04, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #9015, #9611: stdprinter.write() clamps the length to 2^31-1 on Windows
parent
0fcab4a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Misc/NEWS
Misc/NEWS
+2
-2
Objects/fileobject.c
Objects/fileobject.c
+8
-2
No files found.
Misc/NEWS
View file @
dc555400
...
...
@@ -12,8 +12,8 @@ Core and Builtins
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
(length bigger than 2^31-1 bytes).
- Issue #9015, #9611: FileIO.readinto(), FileIO.write()
and os.write() clamp
the length to 2^31-1 on Windows.
- Issue #9015, #9611: FileIO.readinto(), FileIO.write()
, os.write() and
stdprinter.write() clamp
the length to 2^31-1 on Windows.
- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
can now handle dates after 2038.
...
...
Objects/fileobject.c
View file @
dc555400
...
...
@@ -344,7 +344,7 @@ stdprinter_new(PyTypeObject *type, PyObject *args, PyObject *kews)
}
static
int
fileio
_init
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
stdprinter
_init
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyErr_SetString
(
PyExc_TypeError
,
"cannot create 'stderrprinter' instances"
);
...
...
@@ -390,7 +390,13 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
n
>
INT_MAX
)
n
=
INT_MAX
;
n
=
write
(
self
->
fd
,
c
,
(
int
)
n
);
#else
n
=
write
(
self
->
fd
,
c
,
n
);
#endif
Py_END_ALLOW_THREADS
if
(
n
<
0
)
{
...
...
@@ -509,7 +515,7 @@ PyTypeObject PyStdPrinter_Type = {
0
,
/* tp_descr_get */
0
,
/* tp_descr_set */
0
,
/* tp_dictoffset */
fileio_init
,
/* tp_init */
stdprinter_init
,
/* tp_init */
PyType_GenericAlloc
,
/* tp_alloc */
stdprinter_new
,
/* tp_new */
PyObject_Del
,
/* tp_free */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment