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
402d5985
Kaydet (Commit)
402d5985
authored
Agu 27, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, from
Brian Quinlan.
üst
7c47beb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
posixmodule.c
Modules/posixmodule.c
+22
-9
No files found.
Misc/ACKS
Dosyayı görüntüle @
402d5985
...
@@ -317,6 +317,7 @@ Fran
...
@@ -317,6 +317,7 @@ Fran
John Popplewell
John Popplewell
Amrit Prem
Amrit Prem
Paul Prescod
Paul Prescod
Brian Quinlan
Eric Raymond
Eric Raymond
John Redford
John Redford
Terry Reedy
Terry Reedy
...
...
Misc/NEWS
Dosyayı görüntüle @
402d5985
...
@@ -15,6 +15,9 @@ Tests
...
@@ -15,6 +15,9 @@ Tests
Windows
Windows
+ The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
points to command.com (patch from Brian Quinlan).
What's New in Python 2.2a2?
What's New in Python 2.2a2?
===========================
===========================
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
402d5985
...
@@ -2403,13 +2403,23 @@ _PyPopenCreateProcess(char *cmdstring,
...
@@ -2403,13 +2403,23 @@ _PyPopenCreateProcess(char *cmdstring,
int x;
int x;
if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) {
if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) {
char *comshell;
s1 = (char *)_alloca(i);
s1 = (char *)_alloca(i);
if (!(x = GetEnvironmentVariable("COMSPEC", s1, i)))
if (!(x = GetEnvironmentVariable("COMSPEC", s1, i)))
return x;
return x;
if
(
GetVersion
()
<
0x80000000
)
{
/*
/* Explicitly check if we are using COMMAND.COM. If we are
* NT/2000
* then use the w9xpopen hack.
*/
*/
comshell = s1 + x;
while (comshell >= s1 && *comshell != '\\')
--comshell;
++comshell;
if (GetVersion() < 0x80000000 &&
_stricmp(comshell, "command.com") != 0) {
/* NT/2000 and not using command.com. */
x = i + strlen(s3) + strlen(cmdstring) + 1;
x = i + strlen(s3) + strlen(cmdstring) + 1;
s2 = (char *)_alloca(x);
s2 = (char *)_alloca(x);
ZeroMemory(s2, x);
ZeroMemory(s2, x);
...
@@ -2417,8 +2427,8 @@ _PyPopenCreateProcess(char *cmdstring,
...
@@ -2417,8 +2427,8 @@ _PyPopenCreateProcess(char *cmdstring,
}
}
else {
else {
/*
/*
* Oh gag, we're on Win9x
. Use the workaround listed in
* Oh gag, we're on Win9x
or using COMMAND.COM. Use
* KB: Q150956
*
the workaround listed in
KB: Q150956
*/
*/
char modulepath[_MAX_PATH];
char modulepath[_MAX_PATH];
struct stat statinfo;
struct stat statinfo;
...
@@ -2454,7 +2464,8 @@ _PyPopenCreateProcess(char *cmdstring,
...
@@ -2454,7 +2464,8 @@ _PyPopenCreateProcess(char *cmdstring,
if (stat(modulepath, &statinfo) != 0) {
if (stat(modulepath, &statinfo) != 0) {
PyErr_Format(PyExc_RuntimeError,
PyErr_Format(PyExc_RuntimeError,
"Can not locate '%s' which is needed "
"Can not locate '%s' which is needed "
"for popen to work on this platform."
,
"for popen to work with your shell "
"or platform.",
szConsoleSpawn);
szConsoleSpawn);
return FALSE;
return FALSE;
}
}
...
@@ -2478,7 +2489,9 @@ _PyPopenCreateProcess(char *cmdstring,
...
@@ -2478,7 +2489,9 @@ _PyPopenCreateProcess(char *cmdstring,
/* Could be an else here to try cmd.exe / command.com in the path
/* Could be an else here to try cmd.exe / command.com in the path
Now we'll just error out.. */
Now we'll just error out.. */
else {
else {
PyErr_SetString
(
PyExc_RuntimeError
,
"Can not locate a COMSPEC environment variable to use as the shell"
);
PyErr_SetString(PyExc_RuntimeError,
"Cannot locate a COMSPEC environment variable to "
"use as the shell");
return FALSE;
return FALSE;
}
}
...
@@ -2507,7 +2520,7 @@ _PyPopenCreateProcess(char *cmdstring,
...
@@ -2507,7 +2520,7 @@ _PyPopenCreateProcess(char *cmdstring,
*hProcess = piProcInfo.hProcess;
*hProcess = piProcInfo.hProcess;
return TRUE;
return TRUE;
}
}
win32_error
(
"CreateProcess"
,
NULL
);
win32_error("CreateProcess",
s2
);
return FALSE;
return FALSE;
}
}
...
...
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