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
ff45fedf
Kaydet (Commit)
ff45fedf
authored
Mar 03, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11377: Fix quoting on Windows in test_platform
üst
1bc75c6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
test_platform.py
Lib/test/test_platform.py
+11
-2
No files found.
Lib/test/test_platform.py
Dosyayı görüntüle @
ff45fedf
...
@@ -244,14 +244,23 @@ class PlatformTest(unittest.TestCase):
...
@@ -244,14 +244,23 @@ class PlatformTest(unittest.TestCase):
self
.
assertEqual
(
platform
.
_parse_release_file
(
input
),
output
)
self
.
assertEqual
(
platform
.
_parse_release_file
(
input
),
output
)
def
test_popen
(
self
):
def
test_popen
(
self
):
command
=
"'{}' -c 'print(
\"
Hello
\"
)'"
.
format
(
sys
.
executable
)
mswindows
=
(
sys
.
platform
==
"win32"
)
if
mswindows
:
command
=
'"{}" -c "print(
\'
Hello
\'
)"'
.
format
(
sys
.
executable
)
else
:
command
=
"'{}' -c 'print(
\"
Hello
\"
)'"
.
format
(
sys
.
executable
)
with
platform
.
popen
(
command
)
as
stdout
:
with
platform
.
popen
(
command
)
as
stdout
:
hello
=
stdout
.
read
()
.
strip
()
hello
=
stdout
.
read
()
.
strip
()
stdout
.
close
()
stdout
.
close
()
self
.
assertEqual
(
hello
,
"Hello"
)
self
.
assertEqual
(
hello
,
"Hello"
)
command
=
"'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'"
.
format
(
sys
.
executable
)
data
=
'plop'
data
=
'plop'
if
mswindows
:
command
=
'"{}" -c "import sys; data=sys.stdin.read(); exit(len(data))"'
else
:
command
=
"'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'"
command
=
command
.
format
(
sys
.
executable
)
with
platform
.
popen
(
command
,
'w'
)
as
stdin
:
with
platform
.
popen
(
command
,
'w'
)
as
stdin
:
stdout
=
stdin
.
write
(
data
)
stdout
=
stdin
.
write
(
data
)
ret
=
stdin
.
close
()
ret
=
stdin
.
close
()
...
...
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