On 29.09.2017 07:25, 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?
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))
Expected result:
Lorum ipsum dolor sit amet, consectetur adipiscing elit
ZZZ ZZZ sed do euismod tempor incididunt ut labore et
dolore magna aliqua.
Actual result in Python 3.5 and older:
Lorum ipsum dolor sit amet, consectetur adipiscing elit ZZZ
ZZZ sed do euismod tempor incididunt ut labore et dolore
magna aliqua.
I'm pretty sure this is a bug.
Yes, it is a bug, but a known one: https://bugs.python.org/issue20491
The fix got backported even to 3.5, but I guess it depends which minor
version you are running. I'm pretty sure that explains why people report
different outcomes.
Best,
Wolfgang
--
https://mail.python.org/mailman/listinfo/python-list