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
49226e23
Kaydet (Commit)
49226e23
authored
Şub 04, 2017
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
üst
824c6fdf
c008ddeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
NEWS
Misc/NEWS
+2
-0
main.c
Modules/main.c
+12
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
49226e23
...
@@ -10,6 +10,8 @@ What's New in Python 3.7.0 alpha 1?
...
@@ -10,6 +10,8 @@ What's New in Python 3.7.0 alpha 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
- Issue #29337: Fixed possible BytesWarning when compare the code objects.
- Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
Warnings could be emitted at compile time.
...
...
Modules/main.c
Dosyayı görüntüle @
49226e23
...
@@ -228,7 +228,7 @@ static int RunModule(wchar_t *modname, int set_argv0)
...
@@ -228,7 +228,7 @@ static int RunModule(wchar_t *modname, int set_argv0)
static
int
static
int
RunMainFromImporter
(
wchar_t
*
filename
)
RunMainFromImporter
(
wchar_t
*
filename
)
{
{
PyObject
*
argv0
=
NULL
,
*
importer
,
*
sys_path
;
PyObject
*
argv0
=
NULL
,
*
importer
,
*
sys_path
,
*
sys_path0
;
int
sts
;
int
sts
;
argv0
=
PyUnicode_FromWideChar
(
filename
,
wcslen
(
filename
));
argv0
=
PyUnicode_FromWideChar
(
filename
,
wcslen
(
filename
));
...
@@ -253,7 +253,17 @@ RunMainFromImporter(wchar_t *filename)
...
@@ -253,7 +253,17 @@ RunMainFromImporter(wchar_t *filename)
PyErr_SetString
(
PyExc_RuntimeError
,
"unable to get sys.path"
);
PyErr_SetString
(
PyExc_RuntimeError
,
"unable to get sys.path"
);
goto
error
;
goto
error
;
}
}
if
(
PyList_SetItem
(
sys_path
,
0
,
argv0
))
{
sys_path0
=
PyList_GetItem
(
sys_path
,
0
);
sts
=
0
;
if
(
!
sys_path0
)
{
PyErr_Clear
();
sts
=
PyList_Append
(
sys_path
,
argv0
);
}
else
if
(
PyObject_IsTrue
(
sys_path0
))
{
sts
=
PyList_Insert
(
sys_path
,
0
,
argv0
);
}
else
{
sts
=
PyList_SetItem
(
sys_path
,
0
,
argv0
);
}
if
(
sts
)
{
argv0
=
NULL
;
argv0
=
NULL
;
goto
error
;
goto
error
;
}
}
...
...
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