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
718f2223
Kaydet (Commit)
718f2223
authored
Agu 08, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
revert 83832; unix test breakage
üst
6eccb79a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
44 deletions
+2
-44
subprocess.py
Lib/subprocess.py
+1
-1
test_subprocess.py
Lib/test/test_subprocess.py
+1
-43
No files found.
Lib/subprocess.py
Dosyayı görüntüle @
718f2223
...
...
@@ -853,7 +853,7 @@ class Popen(object):
startupinfo
.
dwFlags
|=
_subprocess
.
STARTF_USESHOWWINDOW
startupinfo
.
wShowWindow
=
_subprocess
.
SW_HIDE
comspec
=
os
.
environ
.
get
(
"COMSPEC"
,
"cmd.exe"
)
args
=
comspec
+
" /c "
+
'"
%
s"'
%
args
args
=
comspec
+
" /c "
+
args
if
(
_subprocess
.
GetVersion
()
>=
0x80000000
L
or
os
.
path
.
basename
(
comspec
)
.
lower
()
==
"command.com"
):
# Win9x, or using command.com on NT. We need to
...
...
Lib/test/test_subprocess.py
Dosyayı görüntüle @
718f2223
...
...
@@ -872,54 +872,12 @@ class HelperFunctionTests(unittest.TestCase):
self
.
assertEqual
([(
256
,
999
),
(
666
,),
(
666
,)],
record_calls
)
@unittest.skipUnless
(
mswindows
,
"mswindows only"
)
class
CommandsWithSpaces
(
BaseTestCase
):
def
setUp
(
self
):
super
(
CommandsWithSpaces
,
self
)
.
setUp
()
f
,
fname
=
mkstemp
(
".py"
,
"te st"
)
self
.
fname
=
fname
.
lower
()
os
.
write
(
f
,
b
"import sys;"
b
"sys.stdout.write('
%
d
%
s'
%
(len(sys.argv), [a.lower () for a in sys.argv]))"
)
os
.
close
(
f
)
def
tearDown
(
self
):
os
.
remove
(
self
.
fname
)
super
(
CommandsWithSpaces
,
self
)
.
tearDown
()
def
with_spaces
(
self
,
*
args
,
**
kwargs
):
kwargs
[
'stdout'
]
=
subprocess
.
PIPE
p
=
subprocess
.
Popen
(
*
args
,
**
kwargs
)
self
.
assertEqual
(
p
.
stdout
.
read
()
.
decode
(
"mbcs"
),
"2 [
%
r, 'ab cd']"
%
self
.
fname
)
def
test_shell_string_with_spaces
(
self
):
# call() function with string argument with spaces on Windows
self
.
with_spaces
(
'"
%
s" "
%
s"'
%
(
self
.
fname
,
"ab cd"
),
shell
=
1
)
def
test_shell_sequence_with_spaces
(
self
):
# call() function with sequence argument with spaces on Windows
self
.
with_spaces
([
self
.
fname
,
"ab cd"
],
shell
=
1
)
def
test_noshell_string_with_spaces
(
self
):
# call() function with string argument with spaces on Windows
self
.
with_spaces
(
'"
%
s" "
%
s" "
%
s"'
%
(
sys
.
executable
,
self
.
fname
,
"ab cd"
))
def
test_noshell_sequence_with_spaces
(
self
):
# call() function with sequence argument with spaces on Windows
self
.
with_spaces
([
sys
.
executable
,
self
.
fname
,
"ab cd"
])
def
test_main
():
unit_tests
=
(
ProcessTestCase
,
POSIXProcessTestCase
,
Win32ProcessTestCase
,
ProcessTestCaseNoPoll
,
HelperFunctionTests
,
CommandsWithSpaces
)
HelperFunctionTests
)
test_support
.
run_unittest
(
*
unit_tests
)
test_support
.
reap_children
()
...
...
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