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

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

Closed
PierreQuentel mannequin opened this issue Jan 29, 2011 · 3 comments
Closed

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

PierreQuentel mannequin opened this issue Jan 29, 2011 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@PierreQuentel
Copy link
Mannequin

PierreQuentel mannequin commented Jan 29, 2011

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

    @PierreQuentel
    Copy link
    Mannequin Author

    PierreQuentel mannequin commented Jan 29, 2011

    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

    @PierreQuentel PierreQuentel mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 29, 2011
    @merwok
    Copy link
    Member

    merwok commented Jul 2, 2011

    See also bpo-1610654 and bpo-6234.

    @PierreQuentel
    Copy link
    Mannequin Author

    PierreQuentel mannequin commented Apr 4, 2017

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

    @PierreQuentel PierreQuentel mannequin closed this as completed Apr 4, 2017
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant