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
c5574e80
Kaydet (Commit)
c5574e80
authored
Mar 03, 2005
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar. Backported to 2.4.
üst
4ea3eade
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
12 deletions
+26
-12
_LWPCookieJar.py
Lib/_LWPCookieJar.py
+0
-7
_MozillaCookieJar.py
Lib/_MozillaCookieJar.py
+3
-0
cookielib.py
Lib/cookielib.py
+1
-5
test_cookielib.py
Lib/test/test_cookielib.py
+19
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/_LWPCookieJar.py
Dosyayı görüntüle @
c5574e80
...
@@ -115,13 +115,6 @@ class LWPCookieJar(FileCookieJar):
...
@@ -115,13 +115,6 @@ class LWPCookieJar(FileCookieJar):
for
data
in
split_header_words
([
line
]):
for
data
in
split_header_words
([
line
]):
name
,
value
=
data
[
0
]
name
,
value
=
data
[
0
]
# name and value are an exception here, since a plain "foo"
# (with no "=", unlike "bar=foo") means a cookie with no
# name and value "foo". With all other cookie-attributes,
# the situation is reversed: "foo" means an attribute named
# "foo" with no value!
if
value
is
None
:
name
,
value
=
value
,
name
standard
=
{}
standard
=
{}
rest
=
{}
rest
=
{}
for
k
in
boolean_attrs
:
for
k
in
boolean_attrs
:
...
...
Lib/_MozillaCookieJar.py
Dosyayı görüntüle @
c5574e80
...
@@ -73,6 +73,9 @@ class MozillaCookieJar(FileCookieJar):
...
@@ -73,6 +73,9 @@ class MozillaCookieJar(FileCookieJar):
secure
=
(
secure
==
"TRUE"
)
secure
=
(
secure
==
"TRUE"
)
domain_specified
=
(
domain_specified
==
"TRUE"
)
domain_specified
=
(
domain_specified
==
"TRUE"
)
if
name
==
""
:
if
name
==
""
:
# cookies.txt regards 'Set-Cookie: foo' as a cookie
# with no name, whereas cookielib regards it as a
# cookie with no value.
name
=
value
name
=
value
value
=
None
value
=
None
...
...
Lib/cookielib.py
Dosyayı görüntüle @
c5574e80
...
@@ -451,11 +451,7 @@ def parse_ns_headers(ns_headers):
...
@@ -451,11 +451,7 @@ def parse_ns_headers(ns_headers):
param
=
param
.
rstrip
()
param
=
param
.
rstrip
()
if
param
==
""
:
continue
if
param
==
""
:
continue
if
"="
not
in
param
:
if
"="
not
in
param
:
if
param
.
lower
()
in
known_attrs
:
k
,
v
=
param
,
None
k
,
v
=
param
,
None
else
:
# cookie with missing value
k
,
v
=
param
,
None
else
:
else
:
k
,
v
=
re
.
split
(
r"\s*=\s*"
,
param
,
1
)
k
,
v
=
re
.
split
(
r"\s*=\s*"
,
param
,
1
)
k
=
k
.
lstrip
()
k
=
k
.
lstrip
()
...
...
Lib/test/test_cookielib.py
Dosyayı görüntüle @
c5574e80
...
@@ -231,6 +231,24 @@ def _interact(cookiejar, url, set_cookie_hdrs, hdr_name):
...
@@ -231,6 +231,24 @@ def _interact(cookiejar, url, set_cookie_hdrs, hdr_name):
return
cookie_hdr
return
cookie_hdr
class
FileCookieJarTests
(
TestCase
):
def
test_lwp_valueless_cookie
(
self
):
# cookies with no value should be saved and loaded consistently
from
cookielib
import
LWPCookieJar
filename
=
test_support
.
TESTFN
c
=
LWPCookieJar
()
interact_netscape
(
c
,
"http://www.acme.com/"
,
'boo'
)
self
.
assertEqual
(
c
.
_cookies
[
"www.acme.com"
][
"/"
][
"boo"
]
.
value
,
None
)
try
:
c
.
save
(
filename
,
ignore_discard
=
True
)
c
=
LWPCookieJar
()
c
.
load
(
filename
,
ignore_discard
=
True
)
finally
:
try
:
os
.
unlink
(
filename
)
except
OSError
:
pass
self
.
assertEqual
(
c
.
_cookies
[
"www.acme.com"
][
"/"
][
"boo"
]
.
value
,
None
)
class
CookieTests
(
TestCase
):
class
CookieTests
(
TestCase
):
# XXX
# XXX
# Get rid of string comparisons where not actually testing str / repr.
# Get rid of string comparisons where not actually testing str / repr.
...
@@ -1636,6 +1654,7 @@ def test_main(verbose=None):
...
@@ -1636,6 +1654,7 @@ def test_main(verbose=None):
DateTimeTests
,
DateTimeTests
,
HeaderTests
,
HeaderTests
,
CookieTests
,
CookieTests
,
FileCookieJarTests
,
LWPCookieTests
,
LWPCookieTests
,
)
)
...
...
Misc/NEWS
Dosyayı görüntüle @
c5574e80
...
@@ -61,6 +61,9 @@ Extension Modules
...
@@ -61,6 +61,9 @@ Extension Modules
Library
Library
-------
-------
- Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar.
- Patch #1117339: Add cookielib special name tests.
- Patch #1117339: Add cookielib special name tests.
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
...
...
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