New submission from Devika Sondhi <devi...@iiitd.ac.in>:

textwrap.wrap does not seem to preserve tab character ('\t') in the text if it 
is not separated from other characters by a space.
Example:
>>> textwrap.wrap("Here is\tone line of text that is going to be wrapped after 
>>> 20 columns.",20)                                                           
['Here is one line of', 'text that is going', 'to be wrapped after', '20 
columns.']
The tab is missing from the above output.
However, for text with \t separated by space, the behavior is as expected 
(shown below).
>>> textwrap.wrap("Here is \t one line of text that is going to be wrapped 
>>> after 20 columns.",20)                                                      
>>>    
['Here is          one', 'line of text that is', 'going to be wrapped', 'after 
20 columns.']

----------
components: Tests
messages: 332712
nosy: Devika Sondhi
priority: normal
severity: normal
status: open
title: Text wrap over text containing tab character
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35612>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to