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
5a2da3b3
Kaydet (Commit)
5a2da3b3
authored
Eki 02, 2010
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use proper variable name 'data' instead of 'str' in the send method.
üst
7cafd264
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
client.py
Lib/http/client.py
+10
-10
No files found.
Lib/http/client.py
Dosyayı görüntüle @
5a2da3b3
...
@@ -730,8 +730,8 @@ class HTTPConnection:
...
@@ -730,8 +730,8 @@ class HTTPConnection:
self
.
__response
=
None
self
.
__response
=
None
self
.
__state
=
_CS_IDLE
self
.
__state
=
_CS_IDLE
def
send
(
self
,
str
):
def
send
(
self
,
data
):
"""Send `
str
' to the server."""
"""Send `
data
' to the server."""
if
self
.
sock
is
None
:
if
self
.
sock
is
None
:
if
self
.
auto_open
:
if
self
.
auto_open
:
self
.
connect
()
self
.
connect
()
...
@@ -739,14 +739,14 @@ class HTTPConnection:
...
@@ -739,14 +739,14 @@ class HTTPConnection:
raise
NotConnected
()
raise
NotConnected
()
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
print
(
"send:"
,
repr
(
str
))
print
(
"send:"
,
repr
(
data
))
blocksize
=
8192
blocksize
=
8192
if
hasattr
(
str
,
"read"
)
:
if
hasattr
(
data
,
"read"
)
:
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
print
(
"sendIng a read()able"
)
print
(
"sendIng a read()able"
)
encode
=
False
encode
=
False
try
:
try
:
mode
=
str
.
mode
mode
=
data
.
mode
except
AttributeError
:
except
AttributeError
:
# io.BytesIO and other file-like objects don't have a `mode`
# io.BytesIO and other file-like objects don't have a `mode`
# attribute.
# attribute.
...
@@ -757,14 +757,14 @@ class HTTPConnection:
...
@@ -757,14 +757,14 @@ class HTTPConnection:
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
print
(
"encoding file using iso-8859-1"
)
print
(
"encoding file using iso-8859-1"
)
while
1
:
while
1
:
data
=
str
.
read
(
blocksize
)
data
block
=
data
.
read
(
blocksize
)
if
not
data
:
if
not
data
block
:
break
break
if
encode
:
if
encode
:
data
=
data
.
encode
(
"iso-8859-1"
)
data
block
=
datablock
.
encode
(
"iso-8859-1"
)
self
.
sock
.
sendall
(
data
)
self
.
sock
.
sendall
(
data
block
)
else
:
else
:
self
.
sock
.
sendall
(
str
)
self
.
sock
.
sendall
(
data
)
def
_output
(
self
,
s
):
def
_output
(
self
,
s
):
"""Add a line of output to the current request buffer.
"""Add a line of output to the current request buffer.
...
...
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