Skip to content
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

please sync cgi.parse document #68814

Closed
xwhhsprings mannequin opened this issue Jul 13, 2015 · 2 comments
Closed

please sync cgi.parse document #68814

xwhhsprings mannequin opened this issue Jul 13, 2015 · 2 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@xwhhsprings
Copy link
Mannequin

xwhhsprings mannequin commented Jul 13, 2015

BPO 24626
Nosy @berkerpeksag

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-08-06.11:47:16.657>
created_at = <Date 2015-07-13.03:19:08.183>
labels = ['type-bug', 'invalid', 'docs']
title = 'please sync cgi.parse document'
updated_at = <Date 2016-08-06.11:47:16.656>
user = 'https://bugs.python.org/xwhhsprings'

bugs.python.org fields:

activity = <Date 2016-08-06.11:47:16.656>
actor = 'berker.peksag'
assignee = 'docs@python'
closed = True
closed_date = <Date 2016-08-06.11:47:16.657>
closer = 'berker.peksag'
components = ['Documentation']
creation = <Date 2015-07-13.03:19:08.183>
creator = 'xwhhsprings'
dependencies = []
files = []
hgrepos = []
issue_num = 24626
keywords = []
message_count = 2.0
messages = ['246680', '272096']
nosy_count = 3.0
nosy_names = ['docs@python', 'berker.peksag', 'xwhhsprings']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24626'
versions = ['Python 3.4']

@xwhhsprings
Copy link
Mannequin Author

xwhhsprings mannequin commented Jul 13, 2015

https://docs.python.org/2/library/cgi.html#cgi.parse
(the file defaults to sys.stdin and environment
defaults to os.environ)
https://docs.python.org/3/library/cgi.html#cgi.parse
(the file defaults to sys.stdin)

maby this fix had applied only to python2 branch, so please update to py3 also.

@xwhhsprings xwhhsprings mannequin assigned docspython Jul 13, 2015
@xwhhsprings xwhhsprings mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Jul 13, 2015
@berkerpeksag
Copy link
Member

Thanks for the report!

The default values of fp and environ parameters are already documented in the function signature in Python 3:

    cgi.parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False)

In Python 2, the function signature is:

    cgi.parse(fp[, environ[, keep_blank_values[, strict_parsing]]])

Since the default values cannot be documented in the latter form, we need to specify them separately in plain text.

The reason why "(the file defaults to sys.stdin)" is still in Python 3 documentation is because of the following two lines in cgi.parse() implementation:

    if fp is None:
        fp = sys.stdin

So if you invoke cgi.parse() (which means fp is None) it will be replaced with sys.stdin.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant