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
argparse help formatter does not honor non-breaking space #60827
Comments
Running this code: --------------------------------------- import argparse
p = argparse.ArgumentParser()
p.add_argument('--foo',
help=u'This is a very long help string. ex: "--s3\u00A0s3://my.bucket/dir1/dir2"')
p.parse_args() produces: --------------------------------------- $ ./arg.py --help
usage: arg.py [-h] [--foo FOO] optional arguments: It should not be breaking the line at a non-breaking space. I'm running: Python 2.7.3 (default, Aug 1 2012, 05:14:39) |
The example code works fine using 3.4.1 and 3.5.0a0 on Windows 7. |
The issue here is how http://bugs.python.org/issue20491 textwrap: Non-breaking space not honored Temporarily an |
bpo-29290 reports the same problem as here. |
Ahh, sorry. I made a mistake. It's not the same as 29290. This is about 2.7. Although bpo-20491 is closed but 2.7 seems not patched. Nosy Serhiy. |
I checked the help format. The width is more likely a hardcode in Since python 3.3, the width is a dynamic value in |
oh, typo error. the help_lines' width in python2.7 is different python3.-->the help_lines' width in python2.7 is different with python3.x |
Python 2 is EOL, so I think this issue should be closed. |
+1, if someone need create a PR, we can reopen it again. |
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: