New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textwrap wordsep_re #41617
Comments
The following patch makes textwrap not consider strings For example, this code: but with patch: --- /usr/lib/python2.4/textwrap.py 2005-02-09
04:02:11.000000000 -0800
+++ /tmp/textwrap.py 2005-02-22 17:07:19.000000000 -0800
@@ -79,7 +79,7 @@
# Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/
/the/ /-b/ /option!
# (after stripping out empty strings).
wordsep_re = re.compile(r'(\s+|'
# any whitespace
-
r'[^\s\w]*\w{2,}-(?=\w{2,})|' # hyphenated words
+
r'[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|' # hyphenated words
r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash
# XXX this is not locale- or charset-aware --
string.lowercase |
Logged In: YES Assigned to gward as requested. The attached patch also contains an additional unit test To apply: cd Python-2.4 && patch -p6 < testwrap.patch |
Logged In: YES Thank you! Checked in on release24-maint branch: Merged onto trunk: |
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: