Skip to content

Incorrect documentation for zipfile.writestr() #71498

Closed

Description

@johnthagen
BPO 27311
Nosy @vadmium, @johnthagen
Files
  • 0001-Fix-ZipFile.writestr-data-argument-name.patch
  • 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-06-15.01:43:58.048>
    created_at = <Date 2016-06-14.00:42:20.859>
    labels = ['easy', 'docs']
    title = 'Incorrect documentation for zipfile.writestr()'
    updated_at = <Date 2016-06-15.01:43:58.047>
    user = 'https://github.com/johnthagen'

    bugs.python.org fields:

    activity = <Date 2016-06-15.01:43:58.047>
    actor = 'martin.panter'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2016-06-15.01:43:58.048>
    closer = 'martin.panter'
    components = ['Documentation']
    creation = <Date 2016-06-14.00:42:20.859>
    creator = 'John Hagen'
    dependencies = []
    files = ['43395']
    hgrepos = []
    issue_num = 27311
    keywords = ['patch', 'easy']
    message_count = 6.0
    messages = ['268490', '268495', '268497', '268590', '268592', '268597']
    nosy_count = 4.0
    nosy_names = ['docs@python', 'python-dev', 'martin.panter', 'John Hagen']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue27311'
    versions = ['Python 3.5', 'Python 3.6']

    Activity

    1. johnthagen commented on Jun 14, 2016

      johnthagenmannequin
      MannequinAuthor

      The function signature and description for zipfile.writestr is incorrect:

      https://docs.python.org/3.5/library/zipfile.html#zipfile.ZipFile.writestr

      See:
      https://github.com/python/cpython/blob/master/Lib/zipfile.py#L1610

      The documentation calls the parameter 'bytes', but the real parameter name is 'data'.

      Looks like this was not fixed when the source changed to Python 3:
      https://github.com/python/cpython/blob/2.7/Lib/zipfile.py#L1208

    2. vadmium commented on Jun 14, 2016

      @vadmium
      Member

      Looks like you are right. The change in the implementation happened in revision 19196cce1431.

    3. johnthagen commented on Jun 14, 2016

      johnthagenmannequin
      MannequinAuthor

      I'll submit a patch shortly.

    4. johnthagen commented on Jun 14, 2016

      johnthagenmannequin
      MannequinAuthor

      Patch attached.

    5. vadmium commented on Jun 14, 2016

      @vadmium
      Member

      Thanks John

    6. python-dev commented on Jun 15, 2016

      python-devmannequin
      Mannequin

      New changeset 32af78a8b88f by Martin Panter in branch '3.5':
      Issue bpo-27311: Fix ZipFile.writestr data argument name.
      https://hg.python.org/cpython/rev/32af78a8b88f

      New changeset e3bb87952c62 by Martin Panter in branch 'default':
      Issue bpo-27311: Merge zipfile doc from 3.5
      https://hg.python.org/cpython/rev/e3bb87952c62

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

      docsDocumentation in the Doc direasy

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions