Skip to content

please sync cgi.parse document #68814

Closed
Closed

Description

@xwhhsprings
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']

Activity

  1. xwhhsprings commented on Jul 13, 2015

    xwhhspringsmannequin
    MannequinAuthor

    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.

  2. added
    docs
    type-bug
    on Jul 13, 2015
  3. berkerpeksag commented on Aug 6, 2016

    @berkerpeksag
    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.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docstype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions