Skip to content

bpo-19670: Added SimpleCookie.value_encode/value_decode docs#21017

Open
idomic wants to merge 6 commits into
python:mainfrom
idomic:bpo-19670-cookie
Open

bpo-19670: Added SimpleCookie.value_encode/value_decode docs#21017
idomic wants to merge 6 commits into
python:mainfrom
idomic:bpo-19670-cookie

Conversation

@idomic

@idomic idomic commented Jun 20, 2020

Copy link
Copy Markdown
Contributor

SimpleCookie Generates Non-RFC6265-Compliant Cookies

[bpo-19670](https://bugs.python.org/issue19670): SimpleCookie Generates Non-RFC6265-Compliant Cookies
[3.7] Added SimpleCookie.value_encode/value_decode docs (GH-21017)
[3.8] Added SimpleCookie.value_encode/value_decode docs (GH-21017)
[3.9] Added SimpleCookie.value_encode/value_decode docs (GH-21017)
[3.10] Added SimpleCookie.value_encode/value_decode docs (GH-21017)

https://bugs.python.org/issue19670

@idomic idomic changed the title Added SimpleCookie.value_encode/value_decode docs bpo-19670: Added SimpleCookie.value_encode/value_decode docs Jun 20, 2020
Comment thread Lib/http/cookies.py Outdated
"""
def value_decode(self, val):
"""
Return an unquoted string, from the cookie header in a reversed fasion of value_encode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with other method documentation, could
you start write the docstring on the first line, please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for both, thanks!

Comment thread Lib/http/cookies.py Outdated

def value_encode(self, val):
"""
Return an escaped quoted string, if needed, for the cookie header usage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eamanu fixed both doc strings

Comment thread Lib/http/cookies.py
received from HTTP are kept as strings.
"""
def value_decode(self, val):
"""Return an unquoted string, from the cookie header in a reversed fasion of value_encode.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo:

Suggested change
"""Return an unquoted string, from the cookie header in a reversed fasion of value_encode.
"""Return an unquoted string, from the cookie header in a reversed fashion of value_encode.

And this line width is larger than 80, we should break it.

@@ -0,0 +1 @@
added documentation to `SimpleCookie.value_decode` and `SimpleCookie.value_encode` No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Dev Guide https://devguide.python.org/contrib/core-team/committing/#changes-that-require-news-entries, docs changes don't requires a news entry file.

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 8, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 30, 2026
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants