Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7fe28ad8
Kaydet (Commit)
7fe28ad8
authored
Ock 22, 2017
tarafından
Xiang Zhang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #29290: argparse help messages won't wrap at non-breaking spaces.
üst
d7d87ca9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
argparse.py
Lib/argparse.py
+1
-1
test_argparse.py
Lib/test/test_argparse.py
+17
-0
NEWS
Misc/NEWS
+4
-1
No files found.
Lib/argparse.py
Dosyayı görüntüle @
7fe28ad8
...
@@ -176,7 +176,7 @@ class HelpFormatter(object):
...
@@ -176,7 +176,7 @@ class HelpFormatter(object):
self
.
_root_section
=
self
.
_Section
(
self
,
None
)
self
.
_root_section
=
self
.
_Section
(
self
,
None
)
self
.
_current_section
=
self
.
_root_section
self
.
_current_section
=
self
.
_root_section
self
.
_whitespace_matcher
=
_re
.
compile
(
r'\s+'
)
self
.
_whitespace_matcher
=
_re
.
compile
(
r'\s+'
,
_re
.
ASCII
)
self
.
_long_break_matcher
=
_re
.
compile
(
r'\n\n\n+'
)
self
.
_long_break_matcher
=
_re
.
compile
(
r'\n\n\n+'
)
# ===============================
# ===============================
...
...
Lib/test/test_argparse.py
Dosyayı görüntüle @
7fe28ad8
...
@@ -1943,6 +1943,23 @@ class TestAddSubparsers(TestCase):
...
@@ -1943,6 +1943,23 @@ class TestAddSubparsers(TestCase):
++foo foo help
++foo foo help
'''
))
'''
))
def
test_help_non_breaking_spaces
(
self
):
parser
=
ErrorRaisingArgumentParser
(
prog
=
'PROG'
,
description
=
'main description'
)
parser
.
add_argument
(
"--non-breaking"
,
action
=
'store_false'
,
help
=
'help message containing non-breaking spaces shall not '
'wrap
\
N{NO-BREAK SPACE}at non-breaking spaces'
)
self
.
assertEqual
(
parser
.
format_help
(),
textwrap
.
dedent
(
'''
\
usage: PROG [-h] [--non-breaking]
main description
optional arguments:
-h, --help show this help message and exit
--non-breaking help message containing non-breaking spaces shall not
wrap
\
N{NO-BREAK SPACE}at non-breaking spaces
'''
))
def
test_help_alternate_prefix_chars
(
self
):
def
test_help_alternate_prefix_chars
(
self
):
parser
=
self
.
_get_parser
(
prefix_chars
=
'+:/'
)
parser
=
self
.
_get_parser
(
prefix_chars
=
'+:/'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
7fe28ad8
...
@@ -13,9 +13,12 @@ Core and Builtins
...
@@ -13,9 +13,12 @@ Core and Builtins
Library
Library
-------
-------
- Issue #29290: Fix a regression in argparse that help messages would wrap at
non-breaking spaces.
- Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
- Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
- Issue #29011:
Fix an important omission by adding Deque to the typing module.
- Issue #29011: Fix an important omission by adding Deque to the typing module.
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
ctypes.CDLL instances.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment