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
e2b4452d
Kaydet (Commit)
e2b4452d
authored
Mar 07, 2000
tarafından
Greg Ward
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added '_nt_quote_args()' to deal with whitespace in command-line arguments
in a rather half-assed, but probably effective, way.
üst
73447411
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
spawn.py
Lib/distutils/spawn.py
+22
-5
No files found.
Lib/distutils/spawn.py
Dosyayı görüntüle @
e2b4452d
...
...
@@ -42,11 +42,28 @@ def spawn (cmd,
# spawn ()
def
_spawn_nt
(
cmd
,
search_path
=
1
,
verbose
=
0
,
dry_run
=
0
):
def
_nt_quote_args
(
args
):
"""Obscure quoting command line arguments on NT.
Simply quote every argument which contains blanks."""
# XXX this doesn't seem very robust to me -- but if the Windows guys
# say it'll work, I guess I'll have to accept it. (What if an arg
# contains quotes? What other magic characters, other than spaces,
# have to be escaped? Is there an escaping mechanism other than
# quoting?)
for
i
in
range
(
len
(
args
)):
if
string
.
find
(
args
[
i
],
' '
)
==
-
1
:
args
[
i
]
=
'"
%
s"'
%
args
[
i
]
def
_spawn_nt
(
cmd
,
search_path
=
1
,
verbose
=
0
,
dry_run
=
0
):
executable
=
cmd
[
0
]
cmd
=
_nt_quote_args
(
cmd
)
if
search_path
:
paths
=
string
.
split
(
os
.
environ
[
'PATH'
],
os
.
pathsep
)
base
,
ext
=
os
.
path
.
splitext
(
executable
)
...
...
@@ -60,7 +77,7 @@ def _spawn_nt ( cmd,
# the file exists, we have a shot at spawn working
executable
=
f
if
verbose
:
print
string
.
join
(
[
executable
]
+
cmd
[
1
:],
' '
)
print
string
.
join
([
executable
]
+
cmd
[
1
:],
' '
)
if
not
dry_run
:
# spawn for NT requires a full path to the .exe
try
:
...
...
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