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
811fc149
Kaydet (Commit)
811fc149
authored
Agu 03, 2007
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix status line parsing for http response.
üst
4737482f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
httplib.py
Lib/httplib.py
+7
-2
No files found.
Lib/httplib.py
Dosyayı görüntüle @
811fc149
...
@@ -264,7 +264,7 @@ class HTTPMessage(mimetools.Message):
...
@@ -264,7 +264,7 @@ class HTTPMessage(mimetools.Message):
except
IOError
:
except
IOError
:
startofline
=
tell
=
None
startofline
=
tell
=
None
self
.
seekable
=
0
self
.
seekable
=
0
line
=
s
elf
.
fp
.
readline
(
)
line
=
s
tr
(
self
.
fp
.
readline
(),
"iso-8859-1"
)
if
not
line
:
if
not
line
:
self
.
status
=
'EOF in headers'
self
.
status
=
'EOF in headers'
break
break
...
@@ -317,6 +317,11 @@ class HTTPResponse:
...
@@ -317,6 +317,11 @@ class HTTPResponse:
# See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
# See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
# The bytes from the socket object are iso-8859-1 strings.
# See RFC 2616 sec 2.2 which notes an exception for MIME-encoded
# text following RFC 2047. The basic status line parsing only
# accepts iso-8859-1.
def
__init__
(
self
,
sock
,
debuglevel
=
0
,
strict
=
0
,
method
=
None
):
def
__init__
(
self
,
sock
,
debuglevel
=
0
,
strict
=
0
,
method
=
None
):
self
.
fp
=
sock
.
makefile
(
'rb'
,
0
)
self
.
fp
=
sock
.
makefile
(
'rb'
,
0
)
self
.
debuglevel
=
debuglevel
self
.
debuglevel
=
debuglevel
...
@@ -337,7 +342,7 @@ class HTTPResponse:
...
@@ -337,7 +342,7 @@ class HTTPResponse:
def
_read_status
(
self
):
def
_read_status
(
self
):
# Initialize with Simple-Response defaults
# Initialize with Simple-Response defaults
line
=
s
elf
.
fp
.
readline
(
)
line
=
s
tr
(
self
.
fp
.
readline
(),
"iso-8859-1"
)
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
print
(
"reply:"
,
repr
(
line
))
print
(
"reply:"
,
repr
(
line
))
if
not
line
:
if
not
line
:
...
...
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