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
186c5f07
Kaydet (Commit)
186c5f07
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 Cookie.SimpleCookie with protocol 2.
Patch by Tim Graham.
üst
009352ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
Cookie.py
Lib/Cookie.py
+6
-2
test_cookie.py
Lib/test/test_cookie.py
+13
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/Cookie.py
Dosyayı görüntüle @
186c5f07
...
...
@@ -591,8 +591,12 @@ class BaseCookie(dict):
def
__setitem__
(
self
,
key
,
value
):
"""Dictionary style assignment."""
rval
,
cval
=
self
.
value_encode
(
value
)
self
.
__set
(
key
,
rval
,
cval
)
if
isinstance
(
value
,
Morsel
):
# 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
)
# end __setitem__
def
output
(
self
,
attrs
=
None
,
header
=
"Set-Cookie:"
,
sep
=
"
\015\012
"
):
...
...
Lib/test/test_cookie.py
Dosyayı görüntüle @
186c5f07
...
...
@@ -3,6 +3,7 @@
from
test.test_support
import
run_unittest
,
run_doctest
,
check_warnings
import
unittest
import
Cookie
import
pickle
class
CookieTests
(
unittest
.
TestCase
):
...
...
@@ -141,6 +142,18 @@ class CookieTests(unittest.TestCase):
self
.
assertEqual
(
dict
(
C
),
{})
self
.
assertEqual
(
C
.
output
(),
''
)
def
test_pickle
(
self
):
rawdata
=
'Customer="WILE_E_COYOTE"; Path=/acme; Version=1'
expected_output
=
'Set-Cookie:
%
s'
%
rawdata
C
=
Cookie
.
SimpleCookie
()
C
.
load
(
rawdata
)
self
.
assertEqual
(
C
.
output
(),
expected_output
)
for
proto
in
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
):
C1
=
pickle
.
loads
(
pickle
.
dumps
(
C
,
protocol
=
proto
))
self
.
assertEqual
(
C1
.
output
(),
expected_output
)
def
test_main
():
run_unittest
(
CookieTests
)
...
...
Misc/ACKS
Dosyayı görüntüle @
186c5f07
...
...
@@ -484,6 +484,7 @@ Chris Gonnerman
Shelley Gooch
David Goodger
Hans de Graaff
Tim Graham
Nathaniel Gray
Eddy De Greef
Grant Griffin
...
...
Misc/NEWS
Dosyayı görüntüle @
186c5f07
...
...
@@ -37,6 +37,9 @@ Core and Builtins
Library
-------
-
Issue
#
22775
:
Fixed
unpickling
of
Cookie
.
SimpleCookie
with
protocol
2.
Patch
by
Tim
Graham
.
-
Issue
#
22776
:
Brought
excluded
code
into
the
scope
of
a
try
block
in
SysLogHandler
.
emit
().
...
...
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