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
a051bf3a
Kaydet (Commit)
a051bf3a
authored
Mar 20, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #26581: Use the first coding cookie on a line, not the last one.
üst
fc6990d3
e431d3c9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
6 deletions
+10
-6
IOBinding.py
Lib/idlelib/IOBinding.py
+1
-1
tokenize.py
Lib/lib2to3/pgen2/tokenize.py
+1
-1
test_source_encoding.py
Lib/test/test_importlib/source/test_source_encoding.py
+1
-1
test_source_encoding.py
Lib/test/test_source_encoding.py
+1
-1
tokenize.py
Lib/tokenize.py
+1
-1
NEWS
Misc/NEWS
+3
-0
tokenizer.c
Parser/tokenizer.c
+1
-0
findnocoding.py
Tools/scripts/findnocoding.py
+1
-1
No files found.
Lib/idlelib/IOBinding.py
Dosyayı görüntüle @
a051bf3a
...
@@ -62,7 +62,7 @@ locale_encoding = locale_encoding.lower()
...
@@ -62,7 +62,7 @@ locale_encoding = locale_encoding.lower()
encoding
=
locale_encoding
### KBK 07Sep07 This is used all over IDLE, check!
encoding
=
locale_encoding
### KBK 07Sep07 This is used all over IDLE, check!
### 'encoding' is used below in encode(), check!
### 'encoding' is used below in encode(), check!
coding_re
=
re
.
compile
(
r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
coding_re
=
re
.
compile
(
r'^[ \t\f]*#.*
?
coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
r'^[ \t\f]*(?:[#\r\n]|$)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
r'^[ \t\f]*(?:[#\r\n]|$)'
,
re
.
ASCII
)
def
coding_spec
(
data
):
def
coding_spec
(
data
):
...
...
Lib/lib2to3/pgen2/tokenize.py
Dosyayı görüntüle @
a051bf3a
...
@@ -236,7 +236,7 @@ class Untokenizer:
...
@@ -236,7 +236,7 @@ class Untokenizer:
startline
=
False
startline
=
False
toks_append
(
tokval
)
toks_append
(
tokval
)
cookie_re
=
re
.
compile
(
r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
cookie_re
=
re
.
compile
(
r'^[ \t\f]*#.*
?
coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
br
'^[
\t\f
]*(?:[#
\r\n
]|$)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
br
'^[
\t\f
]*(?:[#
\r\n
]|$)'
,
re
.
ASCII
)
def
_get_normal_name
(
orig_enc
):
def
_get_normal_name
(
orig_enc
):
...
...
Lib/test/test_importlib/source/test_source_encoding.py
Dosyayı görüntüle @
a051bf3a
...
@@ -14,7 +14,7 @@ import unittest
...
@@ -14,7 +14,7 @@ import unittest
import
warnings
import
warnings
CODING_RE
=
re
.
compile
(
r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
CODING_RE
=
re
.
compile
(
r'^[ \t\f]*#.*
?
coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
class
EncodingTest
:
class
EncodingTest
:
...
...
Lib/test/test_source_encoding.py
Dosyayı görüntüle @
a051bf3a
...
@@ -178,7 +178,7 @@ class AbstractSourceEncodingTest:
...
@@ -178,7 +178,7 @@ class AbstractSourceEncodingTest:
def
test_double_coding_same_line
(
self
):
def
test_double_coding_same_line
(
self
):
src
=
(
b
'#coding:iso8859-15 coding:latin1
\n
'
src
=
(
b
'#coding:iso8859-15 coding:latin1
\n
'
b
'print(ascii("
\xc3\xa4
"))
\n
'
)
b
'print(ascii("
\xc3\xa4
"))
\n
'
)
self
.
check_script_output
(
src
,
br
"'
\xc3\
xa4
'"
)
self
.
check_script_output
(
src
,
br
"'
\xc3\
u20ac
'"
)
def
test_first_non_utf8_coding_line
(
self
):
def
test_first_non_utf8_coding_line
(
self
):
src
=
(
b
'#coding:iso-8859-15
\xa4\n
'
src
=
(
b
'#coding:iso-8859-15
\xa4\n
'
...
...
Lib/tokenize.py
Dosyayı görüntüle @
a051bf3a
...
@@ -34,7 +34,7 @@ import re
...
@@ -34,7 +34,7 @@ import re
import
sys
import
sys
from
token
import
*
from
token
import
*
cookie_re
=
re
.
compile
(
r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
cookie_re
=
re
.
compile
(
r'^[ \t\f]*#.*
?
coding[:=][ \t]*([-\w.]+)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
br
'^[
\t\f
]*(?:[#
\r\n
]|$)'
,
re
.
ASCII
)
blank_re
=
re
.
compile
(
br
'^[
\t\f
]*(?:[#
\r\n
]|$)'
,
re
.
ASCII
)
import
token
import
token
...
...
Misc/NEWS
Dosyayı görüntüle @
a051bf3a
...
@@ -10,6 +10,9 @@ Release date: tba
...
@@ -10,6 +10,9 @@ Release date: tba
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #26581: If coding cookie is specified multiple times on a line in
Python source code file, only the first one is taken to account.
- Issue #26563: Debug hooks on Python memory allocators now raise a fatal
- Issue #26563: Debug hooks on Python memory allocators now raise a fatal
error if functions of the :c:func:`PyMem_Malloc` family are called without
error if functions of the :c:func:`PyMem_Malloc` family are called without
holding the GIL.
holding the GIL.
...
...
Parser/tokenizer.c
Dosyayı görüntüle @
a051bf3a
...
@@ -275,6 +275,7 @@ get_coding_spec(const char *s, char **spec, Py_ssize_t size, struct tok_state *t
...
@@ -275,6 +275,7 @@ get_coding_spec(const char *s, char **spec, Py_ssize_t size, struct tok_state *t
return
0
;
return
0
;
}
}
*
spec
=
r
;
*
spec
=
r
;
break
;
}
}
}
}
}
}
...
...
Tools/scripts/findnocoding.py
Dosyayı görüntüle @
a051bf3a
...
@@ -32,7 +32,7 @@ except ImportError:
...
@@ -32,7 +32,7 @@ except ImportError:
"no sophisticated Python source file search will be done."
,
file
=
sys
.
stderr
)
"no sophisticated Python source file search will be done."
,
file
=
sys
.
stderr
)
decl_re
=
re
.
compile
(
rb
'^[
\t\f
]*#.*coding[:=][
\t
]*([-
\
w.]+)'
)
decl_re
=
re
.
compile
(
rb
'^[
\t\f
]*#.*
?
coding[:=][
\t
]*([-
\
w.]+)'
)
blank_re
=
re
.
compile
(
rb
'^[
\t\f
]*(?:[#
\r\n
]|$)'
)
blank_re
=
re
.
compile
(
rb
'^[
\t\f
]*(?:[#
\r\n
]|$)'
)
def
get_declaration
(
line
):
def
get_declaration
(
line
):
...
...
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