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
1cbb3fe7
Kaydet (Commit)
1cbb3fe7
authored
Eki 15, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.3 (#22643)
üst
fd39a89e
e1bd38c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
test_unicode.py
Lib/test/test_unicode.py
+5
-0
NEWS
Misc/NEWS
+3
-0
unicodeobject.c
Objects/unicodeobject.c
+5
-0
No files found.
Lib/test/test_unicode.py
Dosyayı görüntüle @
1cbb3fe7
...
@@ -672,6 +672,11 @@ class UnicodeTest(string_tests.CommonTest,
...
@@ -672,6 +672,11 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertEqual
(
'x'
.
center
(
4
,
'
\U0010FFFF
'
),
self
.
assertEqual
(
'x'
.
center
(
4
,
'
\U0010FFFF
'
),
'
\U0010FFFF
x
\U0010FFFF\U0010FFFF
'
)
'
\U0010FFFF
x
\U0010FFFF\U0010FFFF
'
)
@unittest.skipUnless
(
sys
.
maxsize
==
2
**
31
-
1
,
"requires 32-bit system"
)
def
test_case_operation_overflow
(
self
):
# Issue #22643
self
.
assertRaises
(
OverflowError
,
(
"ü"
*
(
2
**
32
//
12
+
1
))
.
upper
)
def
test_contains
(
self
):
def
test_contains
(
self
):
# Testing Unicode contains method
# Testing Unicode contains method
self
.
assertIn
(
'a'
,
'abdb'
)
self
.
assertIn
(
'a'
,
'abdb'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
1cbb3fe7
...
@@ -11,6 +11,9 @@ Release date: TBA
...
@@ -11,6 +11,9 @@ Release date: TBA
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #22643: Fix integer overflow in Unicode case operations (upper, lower,
title, swapcase, casefold).
- Issue #22604: Fix assertion error in debug mode when dividing a complex
- Issue #22604: Fix assertion error in debug mode when dividing a complex
number by (nan+0j).
number by (nan+0j).
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
1cbb3fe7
...
@@ -9651,6 +9651,11 @@ case_operation(PyObject *self,
...
@@ -9651,6 +9651,11 @@ case_operation(PyObject *self,
kind = PyUnicode_KIND(self);
kind = PyUnicode_KIND(self);
data = PyUnicode_DATA(self);
data = PyUnicode_DATA(self);
length = PyUnicode_GET_LENGTH(self);
length = PyUnicode_GET_LENGTH(self);
if (length > PY_SSIZE_T_MAX / 3 ||
length > PY_SIZE_MAX / (3 * sizeof(Py_UCS4))) {
PyErr_SetString(PyExc_OverflowError, "string is too long");
return NULL;
}
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length);
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length);
if (tmp == NULL)
if (tmp == NULL)
return PyErr_NoMemory();
return PyErr_NoMemory();
...
...
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