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
69032c81
Kaydet (Commit)
69032c81
authored
Kas 03, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at all.
Thanks to Armin Rigo and Alexey Kachayev.
üst
683b46aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
test_cmd_line.py
Lib/test/test_cmd_line.py
+17
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
getpath.c
Modules/getpath.c
+1
-3
No files found.
Lib/test/test_cmd_line.py
Dosyayı görüntüle @
69032c81
...
@@ -216,6 +216,23 @@ class CmdLineTest(unittest.TestCase):
...
@@ -216,6 +216,23 @@ class CmdLineTest(unittest.TestCase):
self
.
assertIn
(
path1
.
encode
(
'ascii'
),
out
)
self
.
assertIn
(
path1
.
encode
(
'ascii'
),
out
)
self
.
assertIn
(
path2
.
encode
(
'ascii'
),
out
)
self
.
assertIn
(
path2
.
encode
(
'ascii'
),
out
)
def
test_empty_PYTHONPATH_issue16309
(
self
):
"""On Posix, it is documented that setting PATH to the
empty string is equivalent to not setting PATH at all,
which is an exception to the rule that in a string like
"/bin::/usr/bin" the empty string in the middle gets
interpreted as '.'"""
code
=
"""if 1:
import sys
path = ":".join(sys.path)
path = path.encode("ascii", "backslashreplace")
sys.stdout.buffer.write(path)"""
rc1
,
out1
,
err1
=
assert_python_ok
(
'-c'
,
code
,
PYTHONPATH
=
""
)
rc2
,
out2
,
err2
=
assert_python_ok
(
'-c'
,
code
)
# regarding to Posix specification, outputs should be equal
# for empty and unset PYTHONPATH
self
.
assertEquals
(
out1
,
out2
)
def
test_displayhook_unencodable
(
self
):
def
test_displayhook_unencodable
(
self
):
for
encoding
in
(
'ascii'
,
'latin-1'
,
'utf-8'
):
for
encoding
in
(
'ascii'
,
'latin-1'
,
'utf-8'
):
env
=
os
.
environ
.
copy
()
env
=
os
.
environ
.
copy
()
...
...
Misc/ACKS
Dosyayı görüntüle @
69032c81
...
@@ -587,6 +587,7 @@ Sijin Joseph
...
@@ -587,6 +587,7 @@ Sijin Joseph
Andreas Jung
Andreas Jung
Tattoo Mabonzo K.
Tattoo Mabonzo K.
Bohuslav Kabrda
Bohuslav Kabrda
Alexey Kachayev
Bob Kahn
Bob Kahn
Kurt B. Kaiser
Kurt B. Kaiser
Tamito Kajiyama
Tamito Kajiyama
...
...
Misc/NEWS
Dosyayı görüntüle @
69032c81
...
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
...
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #16309: Make PYTHONPATH="" behavior the same as if PYTHONPATH
not set at all.
- Issue #10189: Improve the error reporting of SyntaxErrors related to global
- Issue #10189: Improve the error reporting of SyntaxErrors related to global
and nonlocal statements.
and nonlocal statements.
...
...
Modules/getpath.c
Dosyayı görüntüle @
69032c81
...
@@ -699,13 +699,11 @@ calculate_path(void)
...
@@ -699,13 +699,11 @@ calculate_path(void)
*/
*/
bufsz
=
0
;
bufsz
=
0
;
if
(
_rtpypath
)
{
if
(
_rtpypath
&&
_rtpypath
[
0
]
!=
'\0'
)
{
size_t
rtpypath_len
;
size_t
rtpypath_len
;
rtpypath
=
_Py_char2wchar
(
_rtpypath
,
&
rtpypath_len
);
rtpypath
=
_Py_char2wchar
(
_rtpypath
,
&
rtpypath_len
);
if
(
rtpypath
!=
NULL
)
if
(
rtpypath
!=
NULL
)
bufsz
+=
rtpypath_len
+
1
;
bufsz
+=
rtpypath_len
+
1
;
else
_rtpypath
=
NULL
;
}
}
defpath
=
_pythonpath
;
defpath
=
_pythonpath
;
...
...
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