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
394ee009
Kaydet (Commit)
394ee009
authored
Mar 05, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove usage of the deprecated max_buffer_size
üst
36a30cef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
io.rst
Doc/library/io.rst
+9
-6
_pyio.py
Lib/_pyio.py
+5
-8
No files found.
Doc/library/io.rst
Dosyayı görüntüle @
394ee009
...
...
@@ -505,8 +505,9 @@ Buffered Streams
The constructor creates a :class:`BufferedWriter` for the given writeable
*raw* stream. If the *buffer_size* is not given, it defaults to
:data:`DEFAULT_BUFFER_SIZE`. If *max_buffer_size* is omitted, it defaults to
twice the buffer size.
:data:`DEFAULT_BUFFER_SIZE`.
*max_buffer_size* is unused and deprecated.
:class:`BufferedWriter` provides or overrides these methods in addition to
those from :class:`BufferedIOBase` and :class:`IOBase`:
...
...
@@ -532,8 +533,9 @@ Buffered Streams
*reader* and *writer* are :class:`RawIOBase` objects that are readable and
writeable respectively. If the *buffer_size* is omitted it defaults to
:data:`DEFAULT_BUFFER_SIZE`. The *max_buffer_size* (for the buffered writer)
defaults to twice the buffer size.
:data:`DEFAULT_BUFFER_SIZE`.
*max_buffer_size* is unused and deprecated.
:class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods.
...
...
@@ -545,8 +547,9 @@ Buffered Streams
The constructor creates a reader and writer for a seekable raw stream, given
in the first argument. If the *buffer_size* is omitted it defaults to
:data:`DEFAULT_BUFFER_SIZE`. The *max_buffer_size* (for the buffered writer)
defaults to twice the buffer size.
:data:`DEFAULT_BUFFER_SIZE`.
*max_buffer_size* is unused and deprecated.
:class:`BufferedRandom` is capable of anything :class:`BufferedReader` or
:class:`BufferedWriter` can do.
...
...
Lib/_pyio.py
Dosyayı görüntüle @
394ee009
...
...
@@ -971,9 +971,6 @@ class BufferedWriter(_BufferedIOMixin):
if
buffer_size
<=
0
:
raise
ValueError
(
"invalid buffer size"
)
self
.
buffer_size
=
buffer_size
self
.
max_buffer_size
=
(
2
*
buffer_size
if
max_buffer_size
is
None
else
max_buffer_size
)
self
.
_write_buf
=
bytearray
()
self
.
_write_lock
=
Lock
()
...
...
@@ -1000,12 +997,12 @@ class BufferedWriter(_BufferedIOMixin):
try
:
self
.
_flush_unlocked
()
except
BlockingIOError
as
e
:
if
len
(
self
.
_write_buf
)
>
self
.
max_
buffer_size
:
# We've hit
max_buffer_size. We have to accept a
#
partial
write and cut back our buffer.
overage
=
len
(
self
.
_write_buf
)
-
self
.
max_
buffer_size
if
len
(
self
.
_write_buf
)
>
self
.
buffer_size
:
# We've hit
the buffer_size. We have to accept a partial
# write and cut back our buffer.
overage
=
len
(
self
.
_write_buf
)
-
self
.
buffer_size
written
-=
overage
self
.
_write_buf
=
self
.
_write_buf
[:
self
.
max_
buffer_size
]
self
.
_write_buf
=
self
.
_write_buf
[:
self
.
buffer_size
]
raise
BlockingIOError
(
e
.
errno
,
e
.
strerror
,
written
)
return
written
...
...
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