You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2004-06-03.02:00:08.000>created_at=<Date2004-06-03.01:24:16.000>labels= ['library']
title='textwrap does not handle single quotes with hyphens properly'updated_at=<Date2004-06-03.02:00:08.000>user='https://bugs.python.org/gward'
This problem was reported as an Optik bug (bpo-813077),
but it's really a problem in textwrap. (Darn, textwrap
is harder to tweak.) In a nutshell,
TextWrapper._split() splits this string wrong:
"the 'wibble-wobble' widget"
It should split into
['the', ' ', "'wibble-", "wobble'", ' ', 'widget']
but it actually splits into
['the', ' ', "'", 'wibble-', "wobble'", ' ', 'widget']
Looks like that damn regex needs a bit more tweaking.
SIgh.
Turns out the fix was fairly easy: there was already a
special case in wordsep_re so that Optik and Docutils could
wrap long options like "--foo-bar" correctly. Generalizing
that special case to any punctuation ([^\\s\\w]) fixes this bug.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: