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
313523ce
Kaydet (Commit)
313523ce
authored
Eyl 17, 2016
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28192: Don't import readline in isolated mode
üst
d2154ab0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
site.py
Lib/site.py
+7
-5
test_site.py
Lib/test/test_site.py
+2
-6
main.c
Modules/main.c
+2
-1
No files found.
Lib/site.py
Dosyayı görüntüle @
313523ce
...
...
@@ -60,7 +60,8 @@ omitted because it is not mentioned in either path configuration file.
The readline module is also automatically configured to enable
completion for systems that support it. This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.
sitecustomize, usercustomize or PYTHONSTARTUP. Starting Python in
isolated mode (-I) disables automatic readline configuration.
After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
...
...
@@ -491,7 +492,7 @@ def execsitecustomize():
else
:
raise
except
Exception
as
err
:
if
os
.
environ
.
get
(
"PYTHONVERBOSE"
)
:
if
sys
.
flags
.
verbose
:
sys
.
excepthook
(
*
sys
.
exc_info
())
else
:
sys
.
stderr
.
write
(
...
...
@@ -511,7 +512,7 @@ def execusercustomize():
else
:
raise
except
Exception
as
err
:
if
os
.
environ
.
get
(
"PYTHONVERBOSE"
)
:
if
sys
.
flags
.
verbose
:
sys
.
excepthook
(
*
sys
.
exc_info
())
else
:
sys
.
stderr
.
write
(
...
...
@@ -538,12 +539,13 @@ def main():
setquit
()
setcopyright
()
sethelper
()
enablerlcompleter
()
if
not
sys
.
flags
.
isolated
:
enablerlcompleter
()
execsitecustomize
()
if
ENABLE_USER_SITE
:
execusercustomize
()
# Prevent e
dition
of sys.path when python was started with -S and
# Prevent e
xtending
of sys.path when python was started with -S and
# site is imported later.
if
not
sys
.
flags
.
no_site
:
main
()
...
...
Lib/test/test_site.py
Dosyayı görüntüle @
313523ce
...
...
@@ -140,8 +140,6 @@ class HelperFunctionsTests(unittest.TestCase):
self
.
assertRegex
(
err_out
.
getvalue
(),
'Traceback'
)
self
.
assertRegex
(
err_out
.
getvalue
(),
'ModuleNotFoundError'
)
@unittest.skipIf
(
sys
.
platform
==
"win32"
,
"Windows does not raise an "
"error for file paths containing null characters"
)
def
test_addpackage_import_bad_pth_file
(
self
):
# Issue 5258
pth_dir
,
pth_fn
=
self
.
make_pth
(
"abc
\x00
def
\n
"
)
...
...
@@ -447,10 +445,9 @@ class StartupImportTests(unittest.TestCase):
popen
=
subprocess
.
Popen
([
sys
.
executable
,
'-I'
,
'-v'
,
'-c'
,
'import sys; print(set(sys.modules))'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stderr
=
subprocess
.
PIPE
,
encoding
=
'utf-8'
)
stdout
,
stderr
=
popen
.
communicate
()
stdout
=
stdout
.
decode
(
'utf-8'
)
stderr
=
stderr
.
decode
(
'utf-8'
)
modules
=
eval
(
stdout
)
self
.
assertIn
(
'site'
,
modules
)
...
...
@@ -474,6 +471,5 @@ class StartupImportTests(unittest.TestCase):
if
sys
.
platform
!=
'darwin'
:
self
.
assertFalse
(
modules
.
intersection
(
collection_mods
),
stderr
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Modules/main.c
Dosyayı görüntüle @
313523ce
...
...
@@ -703,7 +703,8 @@ Py_Main(int argc, wchar_t **argv)
PySys_SetArgv
(
argc
-
_PyOS_optind
,
argv
+
_PyOS_optind
);
if
((
Py_InspectFlag
||
(
command
==
NULL
&&
filename
==
NULL
&&
module
==
NULL
))
&&
isatty
(
fileno
(
stdin
)))
{
isatty
(
fileno
(
stdin
))
&&
!
Py_IsolatedFlag
)
{
PyObject
*
v
;
v
=
PyImport_ImportModule
(
"readline"
);
if
(
v
==
NULL
)
...
...
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