Skip to content

Commit 71efeb7

Browse files
committed
Merged revisions 71947 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71947 | martin.v.loewis | 2009-04-26 02:53:18 +0200 (So, 26 Apr 2009) | 3 lines Issue #4971: Fix titlecase for characters that are their own titlecase, but not their own uppercase. ........
1 parent 7442bd9 commit 71efeb7

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

Lib/test/test_unicodedata.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class UnicodeMethodsTest(unittest.TestCase):
2121

2222
# update this, if the database changes
23-
expectedchecksum = 'b7db9b5f1d804976fa921d2009cbef6f025620c1'
23+
expectedchecksum = '6ec65b65835614ec00634c674bba0e50cd32c189'
2424

2525
def test_method_checksum(self):
2626
h = hashlib.sha1()
@@ -271,6 +271,11 @@ def test_bug_5828(self):
271271
[0]
272272
)
273273

274+
def test_buf_4971(self):
275+
# LETTER DZ WITH CARON: DZ, Dz, dz
276+
self.assertEqual("\u01c4".title(), "\u01c5")
277+
self.assertEqual("\u01c5".title(), "\u01c5")
278+
self.assertEqual("\u01c6".title(), "\u01c5")
274279

275280
def test_main():
276281
test.support.run_unittest(

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 3.1 beta 1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #4971: Fix titlecase for characters that are their own
16+
titlecase, but not their own uppercase.
17+
1518
- Issue #5283: Setting __class__ in __del__ caused a segfault.
1619

1720
- Issue #5816: complex(repr(z)) now recovers z exactly, even when

Objects/unicodectype.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ int _PyUnicode_IsLinebreak(register const Py_UNICODE ch)
7979
Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
8080
{
8181
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
82-
int delta;
83-
84-
if (ctype->title)
85-
delta = ctype->title;
86-
else
87-
delta = ctype->upper;
82+
int delta = ctype->title;
8883

8984
if (ctype->flags & NODELTA_MASK)
9085
return delta;

0 commit comments

Comments
 (0)