Skip to content

cgi.py proposals : sys.stdout encoding + rewriting of parsing functions #55275

Closed

Description

@PierreQuentel
BPO 11066
Nosy @vstinner, @merwok, @PierreQuentel
Files
  • cgi_20110129.diff: diff for cgi.py
  • 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 2017-04-04.08:49:21.014>
    created_at = <Date 2011-01-29.21:15:40.980>
    labels = ['type-bug', 'library']
    title = 'cgi.py proposals : sys.stdout encoding + rewriting of parsing functions'
    updated_at = <Date 2017-04-04.08:49:21.012>
    user = 'https://github.com/PierreQuentel'

    bugs.python.org fields:

    activity = <Date 2017-04-04.08:49:21.012>
    actor = 'quentel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-04-04.08:49:21.014>
    closer = 'quentel'
    components = ['Library (Lib)']
    creation = <Date 2011-01-29.21:15:40.980>
    creator = 'quentel'
    dependencies = []
    files = ['20612']
    hgrepos = []
    issue_num = 11066
    keywords = ['patch']
    message_count = 3.0
    messages = ['127487', '139647', '291116']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'eric.araujo', 'quentel']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11066'
    versions = ['Python 3.3']

    Activity

    1. PierreQuentel commented on Jan 29, 2011

      PierreQuentelmannequin
      MannequinAuthor

      Python 3.2rc1 introduced a new version of cgi.py that handles correctly file uploads

      In this version, the FieldStorage constructor receives an argument "encoding" which is the encoding used by the document holding the submitted form

      On the CGI script side, there is currently no easy way to print the received form fields with another encoding than sys.stdout.encoding.

      The proposed version introduces a function, set_stdout_encoding(charset), which can be used in the CGI script to set sys.stdout to an instance of a class that uses the charset encoding. This way, print() will use this encoding. "charset" must be the encoding defined in the content-type header sent by the CGI scrpt

      This class (IOMix) was written by Glen Linderman and proposed in the 3.2rc1 version, but no consensus could be reached on time for the release

      Another proposed change is a rewriting of the module-level functions parse() and parse_multipart() : they now use the FieldStorage methods instead

    2. added
      stdlib
      type-bug
      on Jan 29, 2011
    3. merwok commented on Jul 2, 2011

      @merwok
      Member

      See also bpo-1610654 and bpo-6234.

    4. PierreQuentel commented on Apr 4, 2017

      PierreQuentelmannequin
      MannequinAuthor

      I close this issue and will open a more specific one for the rewriting of parse_multipart()

    5. 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

      stdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions