This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mmap doc gives wrong code example
Type: Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, python-dev, xiang.zhang, zach.ware
Priority: normal Keywords: patch

Created on 2016-04-28 17:37 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mmap_doc.patch xiang.zhang, 2016-04-28 17:37 review
Messages (3)
msg264438 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-04-28 17:37
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.
msg264445 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-28 19:48
New changeset 5c8e1b98dc3f by Zachary Ware in branch '3.5':
Issue #26875: Fix mmap example
https://hg.python.org/cpython/rev/5c8e1b98dc3f

New changeset aaf2ad84ae1c by Zachary Ware in branch 'default':
Closes #26875: Merge with 3.5
https://hg.python.org/cpython/rev/aaf2ad84ae1c
msg264446 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-04-28 19:48
Thanks for the report and patch!
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71062
2016-04-28 19:48:43zach.waresetnosy: + zach.ware

messages: + msg264446
versions: + Python 3.5, Python 3.6
2016-04-28 19:48:00python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg264445

resolution: fixed
stage: resolved
2016-04-28 17:37:13xiang.zhangcreate