[issue35612] Text wrap over text containing tab character

Steven D'Aprano report at bugs.python.org
Sat Dec 29 07:09:34 EST 2018


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I think you may be misunderstanding what you are seeing.

The documentation for textwrap.wrap says:

    By default, tabs in 'text' are expanded with string.expandtabs()

which converts tabs to one or more spaces, enough to align to some 
multiple of column 8:

py> "He is\tone".expandtabs()
'He is   one'
py> "Her is\tone".expandtabs()
'Her is  one'
py> "Here is\tone".expandtabs()
'Here is one'
py> "THere is\tone".expandtabs()
'THere is        one'

Can you confirm that this is the behaviour you are seeing? If so, I 
think it is correct and this bug report can be closed.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35612>
_______________________________________


More information about the Python-bugs-list mailing list