Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mwclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WebU
shared
mwclient
Commits
98b850b2
Commit
98b850b2
authored
10 years ago
by
Dan Michael O. Heggø
Browse files
Options
Downloads
Patches
Plain Diff
[#38] Quickfix for cookies not being removed from CookieJar
parent
ed1aea5e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RELEASE-NOTES.md
+2
-0
2 additions, 0 deletions
RELEASE-NOTES.md
mwclient/http.py
+12
-2
12 additions, 2 deletions
mwclient/http.py
with
14 additions
and
2 deletions
RELEASE-NOTES.md
+
2
−
0
View file @
98b850b2
...
...
@@ -50,6 +50,8 @@
[
provided by Semantic MediaWiki
](
http://semantic-mediawiki.org/wiki/Ask_API
)
.
(by
[
@kyv
](
https://github.com/kyv
)
)
[
0a16afc
](
https://github.com/kyv/mwclient/commit/0a16afc
)
*
[2014-05-02] Quickfix for [https://github.com/mwclient/mwclient/issues/38 #38]
(by
[
@danmichaelo
](
https://github.com/danmichaelo
)
)
## Changes in version 0.6.5
Mwclient 0.6.5 was released on 6 May 2011
...
...
This diff is collapsed.
Click to expand it.
mwclient/http.py
+
12
−
2
View file @
98b850b2
...
...
@@ -27,9 +27,19 @@ class CookieJar(dict):
return
value
,
attrs
=
cookie
.
split
(
'
:
'
,
1
)[
1
].
split
(
'
;
'
,
1
)
i
=
value
.
strip
().
split
(
'
=
'
)
if
len
(
i
)
==
1
and
i
[
0
]
in
self
:
# This CookieJar class doesn't care about the `expires` attribute,
# but remove cookies when they are emptied. At some point, the
# mediawiki API started setting the value of cookies to-be-removed
# to 'deleted' instead of emptying them. As a quick fix for
# <https://github.com/mwclient/mwclient/issues/38>, we will remove
# cookies with the value 'deleted' as well, but we should eventually
# replace this class, and probably the whole http class, by something
# more robust. The `requests` library looks like a promising candidate.
if
(
len
(
i
)
==
1
and
i
[
0
]
in
self
)
or
(
len
(
i
)
==
2
and
i
[
0
]
in
self
and
i
[
1
]
==
'
deleted
'
):
del
self
[
i
[
0
]]
el
se
:
el
if
len
(
i
)
==
2
and
i
[
1
]
!=
'
deleted
'
:
self
[
i
[
0
]]
=
i
[
1
]
def
get_cookie_header
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment