﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3714	django.utils.text.wrap() does not properly handle indented text	Bryan Chow	Adrian Holovaty	"wrap() in django.utils.text does not properly handle indented lines of text. When it encounters a line that begins with spaces, it fails to reset the character position counter and thus miscalculates the length of that line. This is due to the use of splitline() on line 20; substituting split('\n') for splitline() resolves this issue.

On line 14 of text.py, the text to be wrapped is split on spaces into words. Therefore, if a line is indented, a word ending with a line break will be encountered.

{{{'word\n'.splitlines()}}} returns {{{['word']}}}

{{{'word\n'.split('\n')}}} returns {{{['word', '']}}}

In the former case, the empty string representing the first word of the next line is disregarded, and thus the test on line 29 doesn't notice that a new line has started.


"		closed	Core (Other)	dev		fixed			Ready for checkin	1	0	0	0	0	0
