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

mmap doc gives wrong code example #71062

Closed
zhangyangyu opened this issue Apr 28, 2016 · 3 comments
Closed

mmap doc gives wrong code example #71062

zhangyangyu opened this issue Apr 28, 2016 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@zhangyangyu
Copy link
Member

BPO 26875
Nosy @zware, @zhangyangyu
Files
  • mmap_doc.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-04-28.19:48:00.413>
    created_at = <Date 2016-04-28.17:37:13.123>
    labels = ['docs']
    title = 'mmap doc gives wrong code example'
    updated_at = <Date 2016-04-28.19:48:43.142>
    user = 'https://github.com/zhangyangyu'

    bugs.python.org fields:

    activity = <Date 2016-04-28.19:48:43.142>
    actor = 'zach.ware'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2016-04-28.19:48:00.413>
    closer = 'python-dev'
    components = ['Documentation']
    creation = <Date 2016-04-28.17:37:13.123>
    creator = 'xiang.zhang'
    dependencies = []
    files = ['42641']
    hgrepos = []
    issue_num = 26875
    keywords = ['patch']
    message_count = 3.0
    messages = ['264438', '264445', '264446']
    nosy_count = 4.0
    nosy_names = ['docs@python', 'python-dev', 'zach.ware', 'xiang.zhang']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue26875'
    versions = ['Python 3.5', 'Python 3.6']

    @zhangyangyu
    Copy link
    Member Author

    The code given in mmap doc

    import mmap
    
    with mmap.mmap(-1, 13) as mm:
        mm.write("Hello world!")

    should be

    mm.write(b"Hello world!")

    The *b* is left out and then causes exception.

    @zhangyangyu zhangyangyu added the docs Documentation in the Doc dir label Apr 28, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 28, 2016

    New changeset 5c8e1b98dc3f by Zachary Ware in branch '3.5':
    Issue bpo-26875: Fix mmap example
    https://hg.python.org/cpython/rev/5c8e1b98dc3f

    New changeset aaf2ad84ae1c by Zachary Ware in branch 'default':
    Closes bpo-26875: Merge with 3.5
    https://hg.python.org/cpython/rev/aaf2ad84ae1c

    @python-dev python-dev mannequin closed this as completed Apr 28, 2016
    @zware
    Copy link
    Member

    zware commented Apr 28, 2016

    Thanks for the report and patch!

    @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
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants