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
db83eb31
Kaydet (Commit)
db83eb31
authored
Ara 18, 2005
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
Needs backport.
üst
e7214a13
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
bad_coding2.py
Lib/test/bad_coding2.py
+3
-0
test_coding.py
Lib/test/test_coding.py
+7
-0
NEWS
Misc/NEWS
+2
-0
tokenizer.c
Parser/tokenizer.c
+6
-0
pythonrun.c
Python/pythonrun.c
+2
-2
No files found.
Lib/test/bad_coding2.py
0 → 100644
Dosyayı görüntüle @
db83eb31
#coding: utf8
print
'我'
\ No newline at end of file
Lib/test/test_coding.py
Dosyayı görüntüle @
db83eb31
...
...
@@ -5,6 +5,13 @@ import os
class
CodingTest
(
unittest
.
TestCase
):
def
test_bad_coding
(
self
):
module_name
=
'bad_coding'
self
.
verify_bad_module
(
module_name
)
def
test_bad_coding2
(
self
):
module_name
=
'bad_coding2'
self
.
verify_bad_module
(
module_name
)
def
verify_bad_module
(
self
,
module_name
):
self
.
assertRaises
(
SyntaxError
,
__import__
,
'test.'
+
module_name
)
path
=
os
.
path
.
dirname
(
__file__
)
...
...
Misc/NEWS
Dosyayı görüntüle @
db83eb31
...
...
@@ -12,6 +12,8 @@ What's New in Python 2.5 alpha 1?
Core and builtins
-----------------
- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
- Support for converting hex strings to floats no longer works.
This was not portable. float('
0x3
') now raises a ValueError.
...
...
Parser/tokenizer.c
Dosyayı görüntüle @
db83eb31
...
...
@@ -292,6 +292,12 @@ check_coding_spec(const char* line, int size, struct tok_state *tok,
PyMem_DEL
(
cs
);
}
}
if
(
!
r
)
{
cs
=
tok
->
encoding
;
if
(
!
cs
)
cs
=
"with BOM"
;
PyErr_Format
(
PyExc_SyntaxError
,
"encoding problem: %s"
,
cs
);
}
return
r
;
}
...
...
Python/pythonrun.c
Dosyayı görüntüle @
db83eb31
...
...
@@ -1439,8 +1439,8 @@ err_input(perrdetail *err)
}
if
(
msg
==
NULL
)
msg
=
"unknown decode error"
;
Py_DECREF
(
type
);
Py_DECREF
(
value
);
Py_
X
DECREF
(
type
);
Py_
X
DECREF
(
value
);
Py_XDECREF
(
tb
);
break
;
}
...
...
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