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
e2b07055
Kaydet (Commit)
e2b07055
authored
Mar 18, 2008
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert r61508: it caused test_mailbox to fail on all platforms.
üst
ada8c3b0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
33 deletions
+5
-33
io.py
Lib/io.py
+0
-0
test_io.py
Lib/test/test_io.py
+5
-33
No files found.
Lib/io.py
Dosyayı görüntüle @
e2b07055
This diff is collapsed.
Click to expand it.
Lib/test/test_io.py
Dosyayı görüntüle @
e2b07055
...
...
@@ -590,9 +590,7 @@ class StatefulIncrementalDecoderTest(unittest.TestCase):
# I=0, O=3
(
b
'i.o3.x.xyz.toolong.'
,
False
,
'x--.xyz.too.'
),
# I=6, O=3
(
b
'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
),
# I=5, O=8 with newlines
(
b
'i.o8.i5.abc
\n
def
\n
ghy
\n
z'
,
True
,
'abc
\n
d---.ef
\n
gh---.y
\n
z-----.'
)
(
b
'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
)
]
def
testDecoder
(
self
):
...
...
@@ -892,8 +890,8 @@ class TextIOWrapperTest(unittest.TestCase):
return
codecs
.
CodecInfo
(
name
=
'test_decoder'
,
encode
=
None
,
decode
=
None
,
incrementalencoder
=
None
,
incrementaldecoder
=
StatefulIncrementalDecoder
,
streamreader
=
None
,
streamwriter
=
None
)
streamreader
=
None
,
streamwriter
=
None
,
incrementaldecoder
=
StatefulIncrementalDecoder
)
def
testSeekAndTellWithData
(
data
,
min_pos
=
0
):
"""Tell/seek to various points within a data stream and ensure
...
...
@@ -905,42 +903,16 @@ class TextIOWrapperTest(unittest.TestCase):
decoded
=
f
.
read
()
f
.
close
()
# Use read() to move to various positions in the input;
# then tell, read some more data, and seek back.
for
i
in
range
(
min_pos
,
len
(
decoded
)
+
1
):
# to read before tell
for
j
in
[
1
,
5
,
len
(
decoded
)]:
# to read after tell
for
i
in
range
(
min_pos
,
len
(
decoded
)
+
1
):
# seek positions
for
j
in
[
1
,
5
,
len
(
decoded
)
-
i
]:
# read lengths
f
=
io
.
open
(
test_support
.
TESTFN
,
encoding
=
'test_decoder'
)
self
.
assertEquals
(
f
.
read
(
i
),
decoded
[:
i
])
cookie
=
f
.
tell
()
self
.
assertEquals
(
f
.
read
(
j
),
decoded
[
i
:
i
+
j
])
f
.
seek
(
cookie
)
self
.
assertEquals
(
f
.
tell
(),
cookie
)
self
.
assertEquals
(
f
.
read
(),
decoded
[
i
:])
f
.
close
()
lines
=
len
(
decoded
.
split
(
'
\n
'
))
# Use readline() to move to various positions in the input;
# then tell, read some more data, and seek back.
for
limit
in
[
-
1
,
4
,
128
]:
# 'limit' argument for readline()
for
j
in
[
1
,
5
,
len
(
decoded
)]:
# to read after tell()
f
=
io
.
open
(
test_support
.
TESTFN
,
encoding
=
'test_decoder'
)
text
=
''
for
k
in
range
(
lines
):
# repeatedly call readline()
line
=
f
.
readline
(
limit
=
limit
)
if
limit
>=
0
:
self
.
assert_
(
len
(
line
)
<=
limit
)
text
+=
line
i
=
len
(
text
)
self
.
assertEquals
(
text
,
decoded
[:
i
])
cookie
=
f
.
tell
()
self
.
assertEquals
(
f
.
read
(
j
),
decoded
[
i
:
i
+
j
])
f
.
seek
(
cookie
)
self
.
assertEquals
(
f
.
tell
(),
cookie
)
self
.
assertEquals
(
f
.
read
(),
decoded
[
i
:])
f
.
seek
(
cookie
)
f
.
close
()
# Register a special incremental decoder for testing.
codecs
.
register
(
lookupTestDecoder
)
self
.
codecEnabled
=
1
...
...
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