Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

idomic
Copy link
Contributor

@idomic idomic commented Jun 20, 2020

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
@@ -605,8 +605,15 @@ class SimpleCookie(BaseCookie):
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
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
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!

return _unquote(val), val

def value_encode(self, val):
"""
Return an escaped quoted string, if needed, for the cookie header usage.
Copy link
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
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

@serhiy-storchaka serhiy-storchaka added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes and removed needs backport to 3.9 only security fixes labels May 20, 2022
@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes and removed needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels May 9, 2024
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@ZeroIntensity ZeroIntensity removed the needs backport to 3.12 only security fixes label May 29, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants