Skip to content

Commit

Permalink
Merged revisions 71947 via svnmerge from
Browse files Browse the repository at this point in the history
svn+ssh://[email protected]/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.
........
  • Loading branch information
loewis committed Apr 26, 2009
1 parent 7442bd9 commit 71efeb7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Lib/test/test_unicodedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class UnicodeMethodsTest(unittest.TestCase):

# update this, if the database changes
expectedchecksum = 'b7db9b5f1d804976fa921d2009cbef6f025620c1'
expectedchecksum = '6ec65b65835614ec00634c674bba0e50cd32c189'

def test_method_checksum(self):
h = hashlib.sha1()
Expand Down Expand Up @@ -271,6 +271,11 @@ def test_bug_5828(self):
[0]
)

def test_buf_4971(self):
# LETTER DZ WITH CARON: DZ, Dz, dz
self.assertEqual("\u01c4".title(), "\u01c5")
self.assertEqual("\u01c5".title(), "\u01c5")
self.assertEqual("\u01c6".title(), "\u01c5")

def test_main():
test.support.run_unittest(
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ What's New in Python 3.1 beta 1?
Core and Builtins
-----------------

- Issue #4971: Fix titlecase for characters that are their own
titlecase, but not their own uppercase.

- Issue #5283: Setting __class__ in __del__ caused a segfault.

- Issue #5816: complex(repr(z)) now recovers z exactly, even when
Expand Down
7 changes: 1 addition & 6 deletions Objects/unicodectype.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ int _PyUnicode_IsLinebreak(register const Py_UNICODE ch)
Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
int delta;

if (ctype->title)
delta = ctype->title;
else
delta = ctype->upper;
int delta = ctype->title;

if (ctype->flags & NODELTA_MASK)
return delta;
Expand Down

0 comments on commit 71efeb7

Please sign in to comment.