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
7248178c
Kaydet (Commit)
7248178c
authored
Eyl 29, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #6790: Make it possible again to pass an `array.array` to
`httplib.HTTPConnection.send`. Patch by Kirk McDonald.
üst
9ebd242f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
httplib.py
Lib/httplib.py
+2
-1
test_httplib.py
Lib/test/test_httplib.py
+16
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/httplib.py
Dosyayı görüntüle @
7248178c
...
...
@@ -66,6 +66,7 @@ Req-started-unread-response _CS_REQ_STARTED <response_class>
Req-sent-unread-response _CS_REQ_SENT <response_class>
"""
from
array
import
array
import
socket
from
sys
import
py3kwarning
from
urlparse
import
urlsplit
...
...
@@ -747,7 +748,7 @@ class HTTPConnection:
print
"send:"
,
repr
(
str
)
try
:
blocksize
=
8192
if
hasattr
(
str
,
'read'
)
:
if
hasattr
(
str
,
'read'
)
and
not
isinstance
(
str
,
array
)
:
if
self
.
debuglevel
>
0
:
print
"sendIng a read()able"
data
=
str
.
read
(
blocksize
)
while
data
:
...
...
Lib/test/test_httplib.py
Dosyayı görüntüle @
7248178c
import
array
import
httplib
import
StringIO
import
socket
...
...
@@ -15,7 +16,7 @@ class FakeSocket:
self
.
data
=
''
def
sendall
(
self
,
data
):
self
.
data
+=
data
self
.
data
+=
''
.
join
(
data
)
def
makefile
(
self
,
mode
,
bufsize
=
None
):
if
mode
!=
'r'
and
mode
!=
'rb'
:
...
...
@@ -162,6 +163,20 @@ class BasicTest(TestCase):
conn
.
request
(
'GET'
,
'/foo'
,
body
)
self
.
assertTrue
(
sock
.
data
.
startswith
(
expected
))
def
test_send
(
self
):
expected
=
'this is a test this is only a test'
conn
=
httplib
.
HTTPConnection
(
'example.com'
)
sock
=
FakeSocket
(
None
)
conn
.
sock
=
sock
conn
.
send
(
expected
)
self
.
assertEquals
(
expected
,
sock
.
data
)
sock
.
data
=
''
conn
.
send
(
array
.
array
(
'c'
,
expected
))
self
.
assertEquals
(
expected
,
sock
.
data
)
sock
.
data
=
''
conn
.
send
(
StringIO
.
StringIO
(
expected
))
self
.
assertEquals
(
expected
,
sock
.
data
)
def
test_chunked
(
self
):
chunked_start
=
(
'HTTP/1.1 200 OK
\r\n
'
...
...
Misc/ACKS
Dosyayı görüntüle @
7248178c
...
...
@@ -477,6 +477,7 @@ Nick Mathewson
Graham Matthews
Dieter Maurer
Arnaud Mazin
Kirk McDonald
Chris McDonough
Greg McFarlane
Alan McIntyre
...
...
Misc/NEWS
Dosyayı görüntüle @
7248178c
...
...
@@ -383,6 +383,9 @@ Core and Builtins
Library
-------
- Issue #6790: Make it possible again to pass an `array.array` to
`httplib.HTTPConnection.send`. Patch by Kirk McDonald.
- Issue #6236, #6348: Fix various failures in the `io` module under AIX
and other platforms, when using a non-gcc compiler. Patch by egreen.
...
...
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