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
8cf7c1cf
Kaydet (Commit)
8cf7c1cf
authored
Kas 02, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
and above. Patch by Tim Graham.
üst
a5c9c37d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
cookies.py
Lib/http/cookies.py
+6
-2
pickletester.py
Lib/test/pickletester.py
+1
-1
test_http_cookies.py
Lib/test/test_http_cookies.py
+14
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/http/cookies.py
Dosyayı görüntüle @
8cf7c1cf
...
@@ -486,8 +486,12 @@ class BaseCookie(dict):
...
@@ -486,8 +486,12 @@ class BaseCookie(dict):
def
__setitem__
(
self
,
key
,
value
):
def
__setitem__
(
self
,
key
,
value
):
"""Dictionary style assignment."""
"""Dictionary style assignment."""
rval
,
cval
=
self
.
value_encode
(
value
)
if
isinstance
(
value
,
Morsel
):
self
.
__set
(
key
,
rval
,
cval
)
# allow assignment of constructed Morsels (e.g. for pickling)
dict
.
__setitem__
(
self
,
key
,
value
)
else
:
rval
,
cval
=
self
.
value_encode
(
value
)
self
.
__set
(
key
,
rval
,
cval
)
def
output
(
self
,
attrs
=
None
,
header
=
"Set-Cookie:"
,
sep
=
"
\015\012
"
):
def
output
(
self
,
attrs
=
None
,
header
=
"Set-Cookie:"
,
sep
=
"
\015\012
"
):
"""Return a string suitable for HTTP."""
"""Return a string suitable for HTTP."""
...
...
Lib/test/pickletester.py
Dosyayı görüntüle @
8cf7c1cf
...
@@ -1284,7 +1284,7 @@ class AbstractPickleTests(unittest.TestCase):
...
@@ -1284,7 +1284,7 @@ class AbstractPickleTests(unittest.TestCase):
loaded
=
self
.
loads
(
DATA5
)
loaded
=
self
.
loads
(
DATA5
)
self
.
assertEqual
(
type
(
loaded
),
SimpleCookie
)
self
.
assertEqual
(
type
(
loaded
),
SimpleCookie
)
self
.
assertEqual
(
list
(
loaded
.
keys
()),
[
"key"
])
self
.
assertEqual
(
list
(
loaded
.
keys
()),
[
"key"
])
self
.
assertEqual
(
loaded
[
"key"
]
.
value
,
"
Set-Cookie: key=
value"
)
self
.
assertEqual
(
loaded
[
"key"
]
.
value
,
"value"
)
for
(
exc
,
data
)
in
DATA7
.
items
():
for
(
exc
,
data
)
in
DATA7
.
items
():
loaded
=
self
.
loads
(
data
)
loaded
=
self
.
loads
(
data
)
...
...
Lib/test/test_http_cookies.py
Dosyayı görüntüle @
8cf7c1cf
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
from
test.support
import
run_unittest
,
run_doctest
,
check_warnings
from
test.support
import
run_unittest
,
run_doctest
,
check_warnings
import
unittest
import
unittest
from
http
import
cookies
from
http
import
cookies
import
pickle
import
warnings
import
warnings
class
CookieTests
(
unittest
.
TestCase
):
class
CookieTests
(
unittest
.
TestCase
):
...
@@ -187,6 +187,19 @@ class CookieTests(unittest.TestCase):
...
@@ -187,6 +187,19 @@ class CookieTests(unittest.TestCase):
self
.
assertEqual
(
dict
(
C
),
{})
self
.
assertEqual
(
dict
(
C
),
{})
self
.
assertEqual
(
C
.
output
(),
''
)
self
.
assertEqual
(
C
.
output
(),
''
)
def
test_pickle
(
self
):
rawdata
=
'Customer="WILE_E_COYOTE"; Path=/acme; Version=1'
expected_output
=
'Set-Cookie:
%
s'
%
rawdata
C
=
cookies
.
SimpleCookie
()
C
.
load
(
rawdata
)
self
.
assertEqual
(
C
.
output
(),
expected_output
)
for
proto
in
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
):
with
self
.
subTest
(
proto
=
proto
):
C1
=
pickle
.
loads
(
pickle
.
dumps
(
C
,
protocol
=
proto
))
self
.
assertEqual
(
C1
.
output
(),
expected_output
)
class
MorselTests
(
unittest
.
TestCase
):
class
MorselTests
(
unittest
.
TestCase
):
"""Tests for the Morsel object."""
"""Tests for the Morsel object."""
...
...
Misc/ACKS
Dosyayı görüntüle @
8cf7c1cf
...
@@ -492,6 +492,7 @@ Chris Gonnerman
...
@@ -492,6 +492,7 @@ Chris Gonnerman
Shelley Gooch
Shelley Gooch
David Goodger
David Goodger
Hans de Graaff
Hans de Graaff
Tim Graham
Nathaniel Gray
Nathaniel Gray
Eddy De Greef
Eddy De Greef
Grant Griffin
Grant Griffin
...
...
Misc/NEWS
Dosyayı görüntüle @
8cf7c1cf
...
@@ -36,6 +36,9 @@ Core and Builtins
...
@@ -36,6 +36,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
and above. Patch by Tim Graham.
- Issue #22366: urllib.request.urlopen will accept a context object
- Issue #22366: urllib.request.urlopen will accept a context object
(SSLContext) as an argument which will then used be for HTTPS connection.
(SSLContext) as an argument which will then used be for HTTPS connection.
Patch by Alex Gaynor.
Patch by Alex Gaynor.
...
...
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