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
11f0b41e
Kaydet (Commit)
11f0b41e
authored
Tem 07, 2012
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14990: tokenize: correctly fail with SyntaxError on invalid encoding declaration.
üst
9235b254
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
test_tokenize.py
Lib/test/test_tokenize.py
+4
-0
tokenize.py
Lib/tokenize.py
+1
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_tokenize.py
Dosyayı görüntüle @
11f0b41e
...
@@ -674,6 +674,10 @@ class TestTokenizerAdheresToPep0263(TestCase):
...
@@ -674,6 +674,10 @@ class TestTokenizerAdheresToPep0263(TestCase):
f
=
'tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt'
f
=
'tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt'
self
.
assertTrue
(
self
.
_testFile
(
f
))
self
.
assertTrue
(
self
.
_testFile
(
f
))
def
test_bad_coding_cookie
(
self
):
self
.
assertRaises
(
SyntaxError
,
self
.
_testFile
,
'bad_coding.py'
)
self
.
assertRaises
(
SyntaxError
,
self
.
_testFile
,
'bad_coding2.py'
)
class
Test_Tokenize
(
TestCase
):
class
Test_Tokenize
(
TestCase
):
...
...
Lib/tokenize.py
Dosyayı görüntüle @
11f0b41e
...
@@ -310,7 +310,7 @@ def detect_encoding(readline):
...
@@ -310,7 +310,7 @@ def detect_encoding(readline):
raise
SyntaxError
(
"unknown encoding: "
+
encoding
)
raise
SyntaxError
(
"unknown encoding: "
+
encoding
)
if
bom_found
:
if
bom_found
:
if
codec
.
name
!=
'utf-8'
:
if
encoding
!=
'utf-8'
:
# This behaviour mimics the Python interpreter
# This behaviour mimics the Python interpreter
raise
SyntaxError
(
'encoding problem: utf-8'
)
raise
SyntaxError
(
'encoding problem: utf-8'
)
encoding
+=
'-sig'
encoding
+=
'-sig'
...
...
Misc/NEWS
Dosyayı görüntüle @
11f0b41e
...
@@ -87,6 +87,9 @@ Core and Builtins
...
@@ -87,6 +87,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #14990: Correctly fail with SyntaxError on invalid encoding
declaration.
- Issue #15247: FileIO now raises an error when given a file descriptor
- Issue #15247: FileIO now raises an error when given a file descriptor
pointing to a directory.
pointing to a directory.
...
...
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