osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Textwrap doesn't honour NO-BREAK SPACE


On Friday, September 29, 2017 at 6:46:31 AM UTC+1, Frank Millman wrote:
> "Steve D'Aprano"  wrote
> 
> I don't have Python 3.6 installed, can somebody check to see whether or not 
> it
> shows the same (wrong) behaviour?
> 
> [...]
> 
> C:\Users\User>python
> Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit 
> (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import textwrap
> >>> text = ('Lorum ipsum dolor sit amet, consectetur adipiscing'
> ...         ' elit ZZZ\xa0ZZZ sed do euismod tempor incididunt'
> ...         ' ut labore et dolore magna aliqua.')
> >>> print(textwrap.fill(text, 59))
> Lorum ipsum dolor sit amet, consectetur adipiscing elit
> ZZZ ZZZ sed do euismod tempor incididunt ut labore et
> dolore magna aliqua.
> >>>
> 
> It seems to have been fixed.
> 
> Frank Millman

FTR https://bugs.python.org/issue20491

--
Kindest regards.

Mark Lawrence.