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
29e2c64e
Kaydet (Commit)
29e2c64e
authored
Haz 26, 2011
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #4608: urllib.request.urlopen does not return an iterable object
üst
58ff0039
038018aa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
test_urllib.py
Lib/test/test_urllib.py
+3
-2
response.py
Lib/urllib/response.py
+8
-4
ACKS
Misc/ACKS
+1
-0
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
29e2c64e
...
...
@@ -110,8 +110,9 @@ class urlopen_FileTests(unittest.TestCase):
# Test iterator
# Don't need to count number of iterations since test would fail the
# instant it returned anything beyond the first line from the
# comparison
for
line
in
self
.
returned_obj
.
__iter__
():
# comparison.
# Use the iterator in the usual implicit way to test for ticket #4608.
for
line
in
self
.
returned_obj
:
self
.
assertEqual
(
line
,
self
.
text
)
class
ProxyTests
(
unittest
.
TestCase
):
...
...
Lib/urllib/response.py
Dosyayı görüntüle @
29e2c64e
...
...
@@ -23,10 +23,14 @@ class addbase(object):
self
.
fileno
=
self
.
fp
.
fileno
else
:
self
.
fileno
=
lambda
:
None
if
hasattr
(
self
.
fp
,
"__iter__"
):
self
.
__iter__
=
self
.
fp
.
__iter__
if
hasattr
(
self
.
fp
,
"__next__"
):
self
.
__next__
=
self
.
fp
.
__next__
def
__iter__
(
self
):
# Assigning `__iter__` to the instance doesn't work as intended
# because the iter builtin does something like `cls.__iter__(obj)`
# and thus fails to find the _bound_ method `obj.__iter__`.
# Returning just `self.fp` works for built-in file objects but
# might not work for general file-like objects.
return
iter
(
self
.
fp
)
def
__repr__
(
self
):
return
'<
%
s at
%
r whose fp =
%
r>'
%
(
self
.
__class__
.
__name__
,
...
...
Misc/ACKS
Dosyayı görüntüle @
29e2c64e
...
...
@@ -325,6 +325,7 @@ Lele Gaifax
Santiago Gala
Yitzchak Gale
Quentin Gallet-Gilles
Riccardo Attilio Galli
Raymund Galvin
Nitin Ganatra
Fred Gansevles
...
...
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