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.parse_multipart is not consistent with FieldStorage #74165

Closed
PierreQuentel mannequin opened this issue Apr 4, 2017 · 4 comments
Closed

cgi.parse_multipart is not consistent with FieldStorage #74165

PierreQuentel mannequin opened this issue Apr 4, 2017 · 4 comments
Assignees
Labels
3.7 stdlib type-bug

Comments

@PierreQuentel
Copy link
Mannequin

@PierreQuentel PierreQuentel mannequin commented Apr 4, 2017

BPO 29979
Nosy @orsenthil, @PierreQuentel, @vadmium
PRs
  • #990
  • #991
  • 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 = 'https://github.com/orsenthil'
    closed_at = <Date 2017-05-08.12:09:05.956>
    created_at = <Date 2017-04-04.08:58:51.066>
    labels = ['3.7', 'type-bug', 'library']
    title = 'cgi.parse_multipart is not consistent with FieldStorage'
    updated_at = <Date 2019-11-17.22:09:31.631>
    user = 'https://github.com/PierreQuentel'

    bugs.python.org fields:

    activity = <Date 2019-11-17.22:09:31.631>
    actor = 'martin.panter'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2017-05-08.12:09:05.956>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2017-04-04.08:58:51.066>
    creator = 'quentel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29979
    keywords = []
    message_count = 4.0
    messages = ['291117', '291122', '291491', '293233']
    nosy_count = 3.0
    nosy_names = ['orsenthil', 'quentel', 'martin.panter']
    pr_nums = ['990', '991']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29979'
    versions = ['Python 3.7']

    @PierreQuentel
    Copy link
    Mannequin Author

    @PierreQuentel PierreQuentel mannequin commented Apr 4, 2017

    In the cgi module, the parse_multipart() function duplicates code from FieldStorage, and the result is not compliant with that of FieldStorage for requests sent with multipart/form-data : for non-file fields, the value associated with a key is a list of *bytes* in parse_multipart() and a list of *strings* for FieldStorage (the bytes decoded with the argument "encoding" passed to FieldStorage()).

    I will propose a PR on the Github repo with a version of parse_multipart that uses FieldStorage and returns the same result (values as strings). The function will take an additional argument "encoding".

    @PierreQuentel PierreQuentel mannequin added 3.7 stdlib type-bug labels Apr 4, 2017
    @orsenthil
    Copy link
    Member

    @orsenthil orsenthil commented Apr 4, 2017

    Looking forward to this.

    @orsenthil orsenthil self-assigned this Apr 4, 2017
    @PierreQuentel
    Copy link
    Mannequin Author

    @PierreQuentel PierreQuentel mannequin commented Apr 11, 2017

    Senthil,

    Can you take a look at the Pull Request when you have time ? The correct PR is #991, not #990.

    @orsenthil
    Copy link
    Member

    @orsenthil orsenthil commented May 8, 2017

    New changeset cc3fa20 by Senthil Kumaran (Pierre Quentel) in branch 'master':
    bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991)
    cc3fa20

    @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
    3.7 stdlib type-bug
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant