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
13e934ac
Kaydet (Commit)
13e934ac
authored
Haz 07, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
correctly overflow when indexes are too large
üst
0b41707d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
test_unicode.py
Lib/test/test_unicode.py
+3
-0
NEWS
Misc/NEWS
+3
-0
string_format.h
Objects/stringlib/string_format.h
+4
-0
No files found.
Lib/test/test_unicode.py
Dosyayı görüntüle @
13e934ac
...
...
@@ -1282,6 +1282,9 @@ class UnicodeTest(
self
.
assertRaises
(
IndexError
,
u"{:}"
.
format
)
self
.
assertRaises
(
IndexError
,
u"{:s}"
.
format
)
self
.
assertRaises
(
IndexError
,
u"{}"
.
format
)
big
=
"23098475029384702983476098230754973209482573"
self
.
assertRaises
(
ValueError
,
(
"{"
+
big
+
"}"
)
.
format
)
self
.
assertRaises
(
ValueError
,
(
"{["
+
big
+
"]}"
)
.
format
,
[
0
])
# issue 6089
self
.
assertRaises
(
ValueError
,
u"{0[0]x}"
.
format
,
[
None
])
...
...
Misc/NEWS
Dosyayı görüntüle @
13e934ac
...
...
@@ -12,6 +12,9 @@ What's New in Python release candidate 2?
Core and Builtins
-----------------
- In the unicode/str.format(), raise a ValueError when either indexes to
arguments are too large.
Library
-------
...
...
Objects/stringlib/string_format.h
Dosyayı görüntüle @
13e934ac
...
...
@@ -373,6 +373,8 @@ FieldNameIterator_next(FieldNameIterator *self, int *is_attribute,
if
(
_FieldNameIterator_item
(
self
,
name
)
==
0
)
return
0
;
*
name_idx
=
get_integer
(
name
);
if
(
*
name_idx
==
-
1
&&
PyErr_Occurred
())
return
0
;
break
;
default:
/* Invalid character follows ']' */
...
...
@@ -429,6 +431,8 @@ field_name_split(STRINGLIB_CHAR *ptr, Py_ssize_t len, SubString *first,
/* see if "first" is an integer, in which case it's used as an index */
*
first_idx
=
get_integer
(
first
);
if
(
*
first_idx
==
-
1
&&
PyErr_Occurred
())
return
0
;
field_name_is_empty
=
first
->
ptr
>=
first
->
end
;
...
...
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