This repository was archived by the owner on Feb 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ def __init__(self,
182182 self ._root_section = self ._Section (self , None )
183183 self ._current_section = self ._root_section
184184
185- self ._whitespace_matcher = _re .compile (r'\s+' )
185+ self ._whitespace_matcher = _re .compile (r'\s+' , _re . ASCII )
186186 self ._long_break_matcher = _re .compile (r'\n\n\n+' )
187187
188188 # ===============================
Original file line number Diff line number Diff line change @@ -1943,6 +1943,23 @@ def test_help_extra_prefix_chars(self):
19431943 ++foo foo help
19441944 ''' ))
19451945
1946+ def test_help_non_breaking_spaces (self ):
1947+ parser = ErrorRaisingArgumentParser (
1948+ prog = 'PROG' , description = 'main description' )
1949+ parser .add_argument (
1950+ "--non-breaking" , action = 'store_false' ,
1951+ help = 'help message containing non-breaking spaces shall not '
1952+ 'wrap\N{NO-BREAK SPACE} at non-breaking spaces' )
1953+ self .assertEqual (parser .format_help (), textwrap .dedent ('''\
1954+ usage: PROG [-h] [--non-breaking]
1955+
1956+ main description
1957+
1958+ optional arguments:
1959+ -h, --help show this help message and exit
1960+ --non-breaking help message containing non-breaking spaces shall not
1961+ wrap\N{NO-BREAK SPACE} at non-breaking spaces
1962+ ''' ))
19461963
19471964 def test_help_alternate_prefix_chars (self ):
19481965 parser = self ._get_parser (prefix_chars = '+:/' )
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ Core and Builtins
4747Library
4848-------
4949
50+ - Issue #29290: Fix a regression in argparse that help messages would wrap at
51+ non-breaking spaces.
52+
5053- Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
5154
5255- Issue #29316: Restore the provisional status of typing module, add
You can’t perform that action at this time.
0 commit comments