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
53071262
Kaydet (Commit)
53071262
authored
May 10, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11169: compileall module uses repr() to format filenames and paths to
escape surrogate characters and show spaces.
üst
1eb4f28c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
compileall.py
Lib/compileall.py
+5
-5
test_compileall.py
Lib/test/test_compileall.py
+1
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/compileall.py
Dosyayı görüntüle @
53071262
...
...
@@ -35,11 +35,11 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
optimize: optimization level or -1 for level of the interpreter
"""
if
not
quiet
:
print
(
'Listing
'
,
dir
,
'...'
)
print
(
'Listing
{!r}...'
.
format
(
dir
)
)
try
:
names
=
os
.
listdir
(
dir
)
except
os
.
error
:
print
(
"Can't list
"
,
dir
)
print
(
"Can't list
{!r}"
.
format
(
dir
)
)
names
=
[]
names
.
sort
()
success
=
1
...
...
@@ -109,13 +109,13 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
except
IOError
:
pass
if
not
quiet
:
print
(
'Compiling
'
,
fullname
,
'...'
)
print
(
'Compiling
{!r}...'
.
format
(
fullname
)
)
try
:
ok
=
py_compile
.
compile
(
fullname
,
cfile
,
dfile
,
True
,
optimize
=
optimize
)
except
py_compile
.
PyCompileError
as
err
:
if
quiet
:
print
(
'*** Error compiling
'
,
fullname
,
'...'
)
print
(
'*** Error compiling
{!r}...'
.
format
(
fullname
)
)
else
:
print
(
'*** '
,
end
=
''
)
# escape non-printable characters in msg
...
...
@@ -126,7 +126,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
success
=
0
except
(
SyntaxError
,
UnicodeError
,
IOError
)
as
e
:
if
quiet
:
print
(
'*** Error compiling
'
,
fullname
,
'...'
)
print
(
'*** Error compiling
{!r}...'
.
format
(
fullname
)
)
else
:
print
(
'*** '
,
end
=
''
)
print
(
e
.
__class__
.
__name__
+
':'
,
e
)
...
...
Lib/test/test_compileall.py
Dosyayı görüntüle @
53071262
...
...
@@ -345,7 +345,7 @@ class CommandLineTests(unittest.TestCase):
def
test_invalid_arg_produces_message
(
self
):
out
=
self
.
assertRunOK
(
'badfilename'
)
self
.
assertRegex
(
out
,
b
"Can't list
badfilename
"
)
self
.
assertRegex
(
out
,
b
"Can't list
'badfilename'
"
)
def
test_main
():
...
...
Misc/NEWS
Dosyayı görüntüle @
53071262
...
...
@@ -86,6 +86,9 @@ Core and Builtins
Library
-------
-
Issue
#
11169
:
compileall
module
uses
repr
()
to
format
filenames
and
paths
to
escape
surrogate
characters
and
show
spaces
.
-
Issue
#
10419
,
#
6011
:
build_scripts
command
of
distutils
handles
correctly
non
-
ASCII
path
(
path
to
the
Python
executable
).
Open
and
write
the
script
in
binary
mode
,
but
ensure
that
the
shebang
is
decodable
from
UTF
-
8
and
from
the
...
...
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