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
e1c67d1d
Kaydet (Commit)
e1c67d1d
authored
May 13, 2002
tarafından
Michael W. Hudson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make StringIO work in --disable-unicode builds...
üst
775c11f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
StringIO.py
Lib/StringIO.py
+2
-2
test_StringIO.py
Lib/test/test_StringIO.py
+2
-0
No files found.
Lib/StringIO.py
Dosyayı görüntüle @
e1c67d1d
...
@@ -39,7 +39,7 @@ __all__ = ["StringIO"]
...
@@ -39,7 +39,7 @@ __all__ = ["StringIO"]
class
StringIO
:
class
StringIO
:
def
__init__
(
self
,
buf
=
''
):
def
__init__
(
self
,
buf
=
''
):
# Force self.buf to be a string or unicode
# Force self.buf to be a string or unicode
if
not
isinstance
(
buf
,
types
.
UnicodeType
):
if
not
isinstance
(
buf
,
types
.
StringTypes
):
buf
=
str
(
buf
)
buf
=
str
(
buf
)
self
.
buf
=
buf
self
.
buf
=
buf
self
.
len
=
len
(
buf
)
self
.
len
=
len
(
buf
)
...
@@ -138,7 +138,7 @@ class StringIO:
...
@@ -138,7 +138,7 @@ class StringIO:
raise
ValueError
,
"I/O operation on closed file"
raise
ValueError
,
"I/O operation on closed file"
if
not
s
:
return
if
not
s
:
return
# Force s to be a string or unicode
# Force s to be a string or unicode
if
not
isinstance
(
s
,
types
.
UnicodeType
):
if
not
isinstance
(
s
,
types
.
StringTypes
):
s
=
str
(
s
)
s
=
str
(
s
)
if
self
.
pos
>
self
.
len
:
if
self
.
pos
>
self
.
len
:
self
.
buflist
.
append
(
'
\0
'
*
(
self
.
pos
-
self
.
len
))
self
.
buflist
.
append
(
'
\0
'
*
(
self
.
pos
-
self
.
len
))
...
...
Lib/test/test_StringIO.py
Dosyayı görüntüle @
e1c67d1d
...
@@ -73,6 +73,8 @@ class TestStringIO(TestGenericStringIO):
...
@@ -73,6 +73,8 @@ class TestStringIO(TestGenericStringIO):
def
test_unicode
(
self
):
def
test_unicode
(
self
):
if
not
test_support
.
have_unicode
:
return
# The StringIO module also supports concatenating Unicode
# The StringIO module also supports concatenating Unicode
# snippets to larger Unicode strings. This is tested by this
# snippets to larger Unicode strings. This is tested by this
# method. Note that cStringIO does not support this extension.
# method. Note that cStringIO does not support this extension.
...
...
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