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
90c0eb28
Kaydet (Commit)
90c0eb28
authored
Kas 01, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16218: Support non ascii characters in python launcher.
Patch by Serhiy Storchaka.
üst
2e99d63e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
test_cmd_line_script.py
Lib/test/test_cmd_line_script.py
+9
-0
pythonrun.c
Python/pythonrun.c
+7
-2
No files found.
Lib/test/test_cmd_line_script.py
Dosyayı görüntüle @
90c0eb28
...
@@ -363,6 +363,15 @@ class CmdLineTest(unittest.TestCase):
...
@@ -363,6 +363,15 @@ class CmdLineTest(unittest.TestCase):
self
.
assertTrue
(
text
[
1
]
.
startswith
(
' File '
))
self
.
assertTrue
(
text
[
1
]
.
startswith
(
' File '
))
self
.
assertTrue
(
text
[
3
]
.
startswith
(
'NameError'
))
self
.
assertTrue
(
text
[
3
]
.
startswith
(
'NameError'
))
def
test_non_utf8
(
self
):
# Issue #16218
with
temp_dir
()
as
script_dir
:
script_name
=
_make_test_script
(
script_dir
,
'
\udcf1\udcea\udcf0\udce8\udcef\udcf2
'
)
self
.
_check_script
(
script_name
,
script_name
,
script_name
,
script_dir
,
None
,
importlib
.
machinery
.
SourceFileLoader
)
def
test_main
():
def
test_main
():
support
.
run_unittest
(
CmdLineTest
)
support
.
run_unittest
(
CmdLineTest
)
support
.
reap_children
()
support
.
reap_children
()
...
...
Python/pythonrun.c
Dosyayı görüntüle @
90c0eb28
...
@@ -1358,16 +1358,21 @@ static set_main_loader(PyObject *d, const char *filename, const char *loader_nam
...
@@ -1358,16 +1358,21 @@ static set_main_loader(PyObject *d, const char *filename, const char *loader_nam
{
{
PyInterpreterState
*
interp
;
PyInterpreterState
*
interp
;
PyThreadState
*
tstate
;
PyThreadState
*
tstate
;
PyObject
*
loader_type
,
*
loader
;
PyObject
*
filename_obj
,
*
loader_type
,
*
loader
;
int
result
=
0
;
int
result
=
0
;
filename_obj
=
PyUnicode_DecodeFSDefault
(
filename
);
if
(
filename_obj
==
NULL
)
return
-
1
;
/* Get current thread state and interpreter pointer */
/* Get current thread state and interpreter pointer */
tstate
=
PyThreadState_GET
();
tstate
=
PyThreadState_GET
();
interp
=
tstate
->
interp
;
interp
=
tstate
->
interp
;
loader_type
=
PyObject_GetAttrString
(
interp
->
importlib
,
loader_name
);
loader_type
=
PyObject_GetAttrString
(
interp
->
importlib
,
loader_name
);
if
(
loader_type
==
NULL
)
{
if
(
loader_type
==
NULL
)
{
Py_DECREF
(
filename_obj
);
return
-
1
;
return
-
1
;
}
}
loader
=
PyObject_CallFunction
(
loader_type
,
"s
s"
,
"__main__"
,
filename
);
loader
=
PyObject_CallFunction
(
loader_type
,
"s
N"
,
"__main__"
,
filename_obj
);
Py_DECREF
(
loader_type
);
Py_DECREF
(
loader_type
);
if
(
loader
==
NULL
)
{
if
(
loader
==
NULL
)
{
return
-
1
;
return
-
1
;
...
...
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