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
d818fc92
Kaydet (Commit)
d818fc92
authored
Nis 02, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.4 (#21134)
üst
f93c27eb
9b09ba12
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
test_exceptions.py
Lib/test/test_exceptions.py
+6
-0
NEWS
Misc/NEWS
+3
-0
exceptions.c
Objects/exceptions.c
+12
-0
No files found.
Lib/test/test_exceptions.py
Dosyayı görüntüle @
d818fc92
...
@@ -800,6 +800,12 @@ class ExceptionTests(unittest.TestCase):
...
@@ -800,6 +800,12 @@ class ExceptionTests(unittest.TestCase):
u
.
start
=
1000
u
.
start
=
1000
self
.
assertEqual
(
str
(
u
),
"can't translate characters in position 1000-4: 965230951443685724997"
)
self
.
assertEqual
(
str
(
u
),
"can't translate characters in position 1000-4: 965230951443685724997"
)
def
test_unicode_errors_no_object
(
self
):
# See issue #21134.
klasses
=
UnicodeDecodeError
,
UnicodeDecodeError
,
UnicodeTranslateError
for
klass
in
klasses
:
self
.
assertEqual
(
str
(
klass
.
__new__
(
klass
)),
""
)
@no_tracing
@no_tracing
def
test_badisinstance
(
self
):
def
test_badisinstance
(
self
):
# Bug #2542: if issubclass(e, MyException) raises an exception,
# Bug #2542: if issubclass(e, MyException) raises an exception,
...
...
Misc/NEWS
Dosyayı görüntüle @
d818fc92
...
@@ -10,6 +10,9 @@ Release date: TBA
...
@@ -10,6 +10,9 @@ Release date: TBA
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #21134: Fix segfault when str is called on an uninitialized
UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
- Issue #19537: Fix PyUnicode_DATA() alignment under m68k. Patch by
- Issue #19537: Fix PyUnicode_DATA() alignment under m68k. Patch by
Andreas Schwab.
Andreas Schwab.
...
...
Objects/exceptions.c
Dosyayı görüntüle @
d818fc92
...
@@ -1837,6 +1837,10 @@ UnicodeEncodeError_str(PyObject *self)
...
@@ -1837,6 +1837,10 @@ UnicodeEncodeError_str(PyObject *self)
PyObject
*
reason_str
=
NULL
;
PyObject
*
reason_str
=
NULL
;
PyObject
*
encoding_str
=
NULL
;
PyObject
*
encoding_str
=
NULL
;
if
(
!
uself
->
object
)
/* Not properly initialized. */
return
PyUnicode_FromString
(
""
);
/* Get reason and encoding as strings, which they might not be if
/* Get reason and encoding as strings, which they might not be if
they've been modified after we were contructed. */
they've been modified after we were contructed. */
reason_str
=
PyObject_Str
(
uself
->
reason
);
reason_str
=
PyObject_Str
(
uself
->
reason
);
...
@@ -1955,6 +1959,10 @@ UnicodeDecodeError_str(PyObject *self)
...
@@ -1955,6 +1959,10 @@ UnicodeDecodeError_str(PyObject *self)
PyObject
*
reason_str
=
NULL
;
PyObject
*
reason_str
=
NULL
;
PyObject
*
encoding_str
=
NULL
;
PyObject
*
encoding_str
=
NULL
;
if
(
!
uself
->
object
)
/* Not properly initialized. */
return
PyUnicode_FromString
(
""
);
/* Get reason and encoding as strings, which they might not be if
/* Get reason and encoding as strings, which they might not be if
they've been modified after we were contructed. */
they've been modified after we were contructed. */
reason_str
=
PyObject_Str
(
uself
->
reason
);
reason_str
=
PyObject_Str
(
uself
->
reason
);
...
@@ -2049,6 +2057,10 @@ UnicodeTranslateError_str(PyObject *self)
...
@@ -2049,6 +2057,10 @@ UnicodeTranslateError_str(PyObject *self)
PyObject
*
result
=
NULL
;
PyObject
*
result
=
NULL
;
PyObject
*
reason_str
=
NULL
;
PyObject
*
reason_str
=
NULL
;
if
(
!
uself
->
object
)
/* Not properly initialized. */
return
PyUnicode_FromString
(
""
);
/* Get reason as a string, which it might not be if it's been
/* Get reason as a string, which it might not be if it's been
modified after we were contructed. */
modified after we were contructed. */
reason_str
=
PyObject_Str
(
uself
->
reason
);
reason_str
=
PyObject_Str
(
uself
->
reason
);
...
...
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