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
6240917b
Unverified
Kaydet (Commit)
6240917b
authored
Şub 20, 2018
tarafından
Steve Dower
Kaydeden (comit)
GitHub
Şub 20, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5757)
üst
5537646b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
test_venv.py
Lib/test/test_venv.py
+18
-0
activate.bat
Lib/venv/scripts/nt/activate.bat
+13
-0
2018-02-19-10-00-57.bpo-32409.nocuDg.rst
...S.d/next/Windows/2018-02-19-10-00-57.bpo-32409.nocuDg.rst
+1
-0
No files found.
Lib/test/test_venv.py
Dosyayı görüntüle @
6240917b
...
...
@@ -281,6 +281,24 @@ class BasicTest(BaseTest):
out
,
err
=
p
.
communicate
()
self
.
assertEqual
(
out
.
strip
(),
envpy
.
encode
())
@unittest.skipUnless
(
os
.
name
==
'nt'
,
'only relevant on Windows'
)
def
test_unicode_in_batch_file
(
self
):
"""
Test isolation from system site-packages
"""
rmtree
(
self
.
env_dir
)
env_dir
=
os
.
path
.
join
(
os
.
path
.
realpath
(
self
.
env_dir
),
'ϼўТλФЙ'
)
builder
=
venv
.
EnvBuilder
(
clear
=
True
)
builder
.
create
(
env_dir
)
activate
=
os
.
path
.
join
(
env_dir
,
self
.
bindir
,
'activate.bat'
)
envpy
=
os
.
path
.
join
(
env_dir
,
self
.
bindir
,
self
.
exe
)
cmd
=
[
activate
,
'&'
,
self
.
exe
,
'-c'
,
'print(0)'
]
p
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
encoding
=
'oem'
,
shell
=
True
)
out
,
err
=
p
.
communicate
()
print
(
err
)
self
.
assertEqual
(
out
.
strip
(),
'0'
)
@skipInVenv
class
EnsurePipTest
(
BaseTest
):
...
...
Lib/venv/scripts/nt/activate.bat
Dosyayı görüntüle @
6240917b
@echo off
rem This file is UTF-8 encoded, so we need to update the current code page while executing it
for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do (
set "_OLD_CODEPAGE=%%a"
)
if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" 65001 > nul
)
set "VIRTUAL_ENV=__VENV_DIR__"
if not defined PROMPT (
...
...
@@ -30,3 +39,7 @@ if defined _OLD_VIRTUAL_PATH (
set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%"
:END
if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
set "_OLD_CODEPAGE="
)
Misc/NEWS.d/next/Windows/2018-02-19-10-00-57.bpo-32409.nocuDg.rst
0 → 100644
Dosyayı görüntüle @
6240917b
Ensures activate.bat can handle Unicode contents.
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