Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e6edec23
Kaydet (Commit)
e6edec23
authored
Ock 04, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9015, #9611: FileIO.readinto(), FileIO.write() and os.write() clamp the
length to 2^31-1 on Windows.
üst
560f9dab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
NEWS
Misc/NEWS
+3
-0
fileio.c
Modules/_io/fileio.c
+18
-4
posixmodule.c
Modules/posixmodule.c
+9
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
e6edec23
...
...
@@ -8,6 +8,9 @@ What's New in Python 3.2 Release Candidate 1
Core and Builtins
-----------------
- Issue #9015, #9611: FileIO.readinto(), FileIO.write() and os.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.
...
...
Modules/_io/fileio.c
Dosyayı görüntüle @
e6edec23
...
...
@@ -506,7 +506,7 @@ static PyObject *
fileio_readinto
(
fileio
*
self
,
PyObject
*
args
)
{
Py_buffer
pbuf
;
Py_ssize_t
n
;
Py_ssize_t
n
,
len
;
if
(
self
->
fd
<
0
)
return
err_closed
();
...
...
@@ -517,9 +517,16 @@ fileio_readinto(fileio *self, PyObject *args)
return
NULL
;
if
(
_PyVerify_fd
(
self
->
fd
))
{
len
=
pbuf
.
len
;
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
n
=
read
(
self
->
fd
,
pbuf
.
buf
,
pbuf
.
len
);
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
len
>
INT_MAX
)
len
=
INT_MAX
;
n
=
read
(
self
->
fd
,
pbuf
.
buf
,
(
int
)
len
);
#else
n
=
read
(
self
->
fd
,
pbuf
.
buf
,
(
size_t
)
len
);
#endif
Py_END_ALLOW_THREADS
}
else
n
=
-
1
;
...
...
@@ -685,7 +692,7 @@ static PyObject *
fileio_write
(
fileio
*
self
,
PyObject
*
args
)
{
Py_buffer
pbuf
;
Py_ssize_t
n
;
Py_ssize_t
n
,
len
;
if
(
self
->
fd
<
0
)
return
err_closed
();
...
...
@@ -698,7 +705,14 @@ fileio_write(fileio *self, PyObject *args)
if
(
_PyVerify_fd
(
self
->
fd
))
{
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
n
=
write
(
self
->
fd
,
pbuf
.
buf
,
pbuf
.
len
);
len
=
pbuf
.
len
;
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
len
>
INT_MAX
)
len
=
INT_MAX
;
n
=
write
(
self
->
fd
,
pbuf
.
buf
,
(
int
)
len
);
#else
n
=
write
(
self
->
fd
,
pbuf
.
buf
,
(
size_t
)
len
);
#endif
Py_END_ALLOW_THREADS
}
else
n
=
-
1
;
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
e6edec23
...
...
@@ -5696,7 +5696,7 @@ posix_write(PyObject *self, PyObject *args)
{
Py_buffer
pbuf
;
int
fd
;
Py_ssize_t
size
;
Py_ssize_t
size
,
len
;
if
(
!
PyArg_ParseTuple
(
args
,
"iy*:write"
,
&
fd
,
&
pbuf
))
return
NULL
;
...
...
@@ -5704,8 +5704,15 @@ posix_write(PyObject *self, PyObject *args)
PyBuffer_Release
(
&
pbuf
);
return
posix_error
();
}
len
=
pbuf
.
len
;
Py_BEGIN_ALLOW_THREADS
size
=
write
(
fd
,
pbuf
.
buf
,
(
size_t
)
pbuf
.
len
);
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
len
>
INT_MAX
)
len
=
INT_MAX
;
size
=
write
(
fd
,
pbuf
.
buf
,
(
int
)
len
);
#else
size
=
write
(
fd
,
pbuf
.
buf
,
(
size_t
)
len
);
#endif
Py_END_ALLOW_THREADS
PyBuffer_Release
(
&
pbuf
);
if
(
size
<
0
)
...
...
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