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: correct characters in TextWrapper.replace_whitespace docs
Type: Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: asvetlov, chris.jerdonek, docs@python, python-dev
Priority: normal Keywords: easy, patch

Created on 2012-07-30 04:10 by chris.jerdonek, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-textwrap-whitespace.patch chris.jerdonek, 2012-07-30 04:10 review
Messages (3)
msg166855 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-30 04:10
This issue is to correct the list of whitespace characters to replace in the documentation for the textwrap module's TextWrapper.replace_whitespace attribute.

The documentation says this list is string.whitespace:

http://docs.python.org/dev/library/textwrap.html#textwrap.TextWrapper.replace_whitespace

However, the code deliberately avoids using string.whitespace and uses a hard-coded list of characters instead.  For example, see this code comment:

# Hardcode the recognized whitespace characters to the US-ASCII
# whitespace characters.  The main reason for doing this is that in
# ISO-8859-1, 0xa0 is non-breaking whitespace, so in certain locales
# that character winds up in string.whitespace....

http://hg.python.org/cpython/file/917295aaad76/Lib/textwrap.py#l12

Patch attached.
msg168142 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-08-13 20:26
New changeset 90a8a462d2f7 by Andrew Svetlov in branch '3.2':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/90a8a462d2f7

New changeset edcbf3edf701 by Andrew Svetlov in branch 'default':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/edcbf3edf701

New changeset 3bddc965e2ea by Andrew Svetlov in branch '2.7':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/3bddc965e2ea
msg168143 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-08-13 20:27
Done. Thanks, Chris.
History
Date User Action Args
2022-04-11 14:57:33adminsetgithub: 59702
2012-08-13 20:27:36asvetlovsetstatus: open -> closed
resolution: fixed
messages: + msg168143

stage: patch review -> resolved
2012-08-13 20:26:47python-devsetnosy: + python-dev
messages: + msg168142
2012-08-13 19:27:42chris.jerdoneksetnosy: + asvetlov

versions: + Python 3.2
2012-07-30 04:10:40chris.jerdonekcreate