-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
base: main
Are you sure you want to change the base?
Conversation
Lib/http/cookies.py
Outdated
@@ -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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for both, thanks!
Lib/http/cookies.py
Outdated
return _unquote(val), val | ||
|
||
def value_encode(self, val): | ||
""" | ||
Return an escaped quoted string, if needed, for the cookie header usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
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
SimpleCookie Generates Non-RFC6265-Compliant Cookies
https://bugs.python.org/issue19670