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
e35553e2
Kaydet (Commit)
e35553e2
authored
May 16, 2007
tarafından
Walter Dörwald
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix io.StringIO for wide Python builds.
üst
9d2ac227
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
io.py
Lib/io.py
+11
-6
No files found.
Lib/io.py
Dosyayı görüntüle @
e35553e2
...
@@ -598,6 +598,8 @@ class StringIO(_MemoryIOMixin):
...
@@ -598,6 +598,8 @@ class StringIO(_MemoryIOMixin):
# Reuses the same code as BytesIO, but encode strings on the way in
# Reuses the same code as BytesIO, but encode strings on the way in
# and decode them on the way out.
# and decode them on the way out.
charsize
=
len
(
"!"
.
encode
(
"unicode-internal"
))
def
__init__
(
self
,
initial_string
=
None
):
def
__init__
(
self
,
initial_string
=
None
):
if
initial_string
is
not
None
:
if
initial_string
is
not
None
:
buffer
=
initial_string
.
encode
(
"unicode-internal"
)
buffer
=
initial_string
.
encode
(
"unicode-internal"
)
...
@@ -609,21 +611,24 @@ class StringIO(_MemoryIOMixin):
...
@@ -609,21 +611,24 @@ class StringIO(_MemoryIOMixin):
return
self
.
_buffer
.
encode
(
"unicode-internal"
)
return
self
.
_buffer
.
encode
(
"unicode-internal"
)
def
read
(
self
,
n
=-
1
):
def
read
(
self
,
n
=-
1
):
return
super
(
StringIO
,
self
)
.
read
(
n
*
2
)
.
decode
(
"unicode-internal"
)
return
super
(
StringIO
,
self
)
.
read
(
n
*
self
.
charsize
)
\
.
decode
(
"unicode-internal"
)
def
write
(
self
,
s
):
def
write
(
self
,
s
):
return
super
(
StringIO
,
self
)
.
write
(
s
.
encode
(
"unicode-internal"
))
//
2
return
super
(
StringIO
,
self
)
.
write
(
s
.
encode
(
"unicode-internal"
))
\
//
self
.
charsize
def
seek
(
self
,
pos
,
whence
=
0
):
def
seek
(
self
,
pos
,
whence
=
0
):
return
super
(
StringIO
,
self
)
.
seek
(
2
*
pos
,
whence
)
//
2
return
super
(
StringIO
,
self
)
.
seek
(
self
.
charsize
*
pos
,
whence
)
\
//
self
.
charsize
def
tell
(
self
):
def
tell
(
self
):
return
super
(
StringIO
,
self
)
.
tell
()
//
2
return
super
(
StringIO
,
self
)
.
tell
()
//
self
.
charsize
def
truncate
(
self
,
pos
=
None
):
def
truncate
(
self
,
pos
=
None
):
if
pos
is
not
None
:
if
pos
is
not
None
:
pos
*=
2
pos
*=
self
.
charsize
return
super
(
StringIO
,
self
)
.
truncate
(
pos
)
//
2
return
super
(
StringIO
,
self
)
.
truncate
(
pos
)
//
self
.
charsize
def
readinto
(
self
,
b
:
bytes
)
->
int
:
def
readinto
(
self
,
b
:
bytes
)
->
int
:
self
.
_unsupported
(
"readinto"
)
self
.
_unsupported
(
"readinto"
)
...
...
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