[Python-3000-checkins] r57640 - python/branches/py3k/Lib/gettext.py
guido.van.rossum
python-3000-checkins at python.org
Wed Aug 29 05:08:55 CEST 2007
Author: guido.van.rossum
Date: Wed Aug 29 05:08:55 2007
New Revision: 57640
Modified:
python/branches/py3k/Lib/gettext.py
Log:
Make gettext work with strict str/bytes.
Modified: python/branches/py3k/Lib/gettext.py
==============================================================================
--- python/branches/py3k/Lib/gettext.py (original)
+++ python/branches/py3k/Lib/gettext.py Wed Aug 29 05:08:55 2007
@@ -292,7 +292,7 @@
if mlen == 0:
# Catalog description
lastk = k = None
- for b_item in tmsg.split(os.linesep):
+ for b_item in tmsg.split(os.linesep.encode("ascii")):
item = str(b_item).strip()
if not item:
continue
@@ -321,8 +321,8 @@
# if the Unicode conversion fails.
if b'\x00' in msg:
# Plural forms
- msgid1, msgid2 = msg.split('\x00')
- tmsg = tmsg.split('\x00')
+ msgid1, msgid2 = msg.split(b'\x00')
+ tmsg = tmsg.split(b'\x00')
if self._charset:
msgid1 = str(msgid1, self._charset)
tmsg = [str(x, self._charset) for x in tmsg]
More information about the Python-3000-checkins
mailing list