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
fd16fcaf
Kaydet (Commit)
fd16fcaf
authored
Agu 09, 2016
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21999: Handled empty strings correctly when in POSIX mode.
üst
e1f3afbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
shlex.py
Lib/shlex.py
+1
-1
test_shlex.py
Lib/test/test_shlex.py
+13
-0
No files found.
Lib/shlex.py
Dosyayı görüntüle @
fd16fcaf
...
@@ -230,7 +230,7 @@ class shlex:
...
@@ -230,7 +230,7 @@ class shlex:
if
self
.
debug
>=
2
:
if
self
.
debug
>=
2
:
print
"shlex: I see punctuation in word state"
print
"shlex: I see punctuation in word state"
self
.
state
=
' '
self
.
state
=
' '
if
self
.
token
:
if
self
.
token
or
(
self
.
posix
and
quoted
)
:
break
# emit current token
break
# emit current token
else
:
else
:
continue
continue
...
...
Lib/test/test_shlex.py
Dosyayı görüntüle @
fd16fcaf
...
@@ -178,6 +178,19 @@ class ShlexTest(unittest.TestCase):
...
@@ -178,6 +178,19 @@ class ShlexTest(unittest.TestCase):
"
%
s:
%
s !=
%
s"
%
"
%
s:
%
s !=
%
s"
%
(
self
.
data
[
i
][
0
],
l
,
self
.
data
[
i
][
1
:]))
(
self
.
data
[
i
][
0
],
l
,
self
.
data
[
i
][
1
:]))
def
testEmptyStringHandling
(
self
):
"""Test that parsing of empty strings is correctly handled."""
# see Issue #21999
expected
=
[
''
,
')'
,
'abc'
]
s
=
shlex
.
shlex
(
"'')abc"
,
posix
=
True
)
slist
=
list
(
s
)
self
.
assertEqual
(
slist
,
expected
)
expected
=
[
"''"
,
')'
,
'abc'
]
s
=
shlex
.
shlex
(
"'')abc"
)
self
.
assertEqual
(
list
(
s
),
expected
)
# Allow this test to be used with old shlex.py
# Allow this test to be used with old shlex.py
if
not
getattr
(
shlex
,
"split"
,
None
):
if
not
getattr
(
shlex
,
"split"
,
None
):
for
methname
in
dir
(
ShlexTest
):
for
methname
in
dir
(
ShlexTest
):
...
...
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