[Python-modules-commits] r13713 - in packages/utidylib/trunk/debian (3 files)

nijel at users.alioth.debian.org nijel at users.alioth.debian.org
Tue Jun 29 12:45:52 UTC 2010


    Date: Tuesday, June 29, 2010 @ 12:45:46
  Author: nijel
Revision: 13713

Add support for handling unicode strings (Closes: #339818).

Added:
  packages/utidylib/trunk/debian/patches/unicode-strings.patch
Modified:
  packages/utidylib/trunk/debian/changelog
  packages/utidylib/trunk/debian/patches/series

Modified: packages/utidylib/trunk/debian/changelog
===================================================================
--- packages/utidylib/trunk/debian/changelog	2010-06-29 11:19:13 UTC (rev 13712)
+++ packages/utidylib/trunk/debian/changelog	2010-06-29 12:45:46 UTC (rev 13713)
@@ -1,8 +1,8 @@
 utidylib (0.2-6) UNRELEASED; urgency=low
 
-  * NOT RELEASED YET
+  * Add support for handling unicode strings (Closes: #339818).
 
- -- Michal ÄŒihaÅ™ <nijel at debian.org>  Tue, 29 Jun 2010 10:45:30 +0200
+ -- Michal ÄŒihaÅ™ <nijel at debian.org>  Tue, 29 Jun 2010 14:45:14 +0200
 
 utidylib (0.2-5) unstable; urgency=low
 

Modified: packages/utidylib/trunk/debian/patches/series
===================================================================
--- packages/utidylib/trunk/debian/patches/series	2010-06-29 11:19:13 UTC (rev 13712)
+++ packages/utidylib/trunk/debian/patches/series	2010-06-29 12:45:46 UTC (rev 13713)
@@ -1,2 +1,3 @@
+unicode-strings.patch
 fix_libtidy_import.patch
 fix-pointer-size.patch

Added: packages/utidylib/trunk/debian/patches/unicode-strings.patch
===================================================================
--- packages/utidylib/trunk/debian/patches/unicode-strings.patch	                        (rev 0)
+++ packages/utidylib/trunk/debian/patches/unicode-strings.patch	2010-06-29 12:45:46 UTC (rev 13713)
@@ -0,0 +1,20 @@
+From: Michal ÄŒihaÅ™ <nijel at debian.org>
+Subject: Fix handling of unicode strings
+Forwarded: https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=3011&group_id=1810
+
+--- a/tidy/lib.py
++++ b/tidy/lib.py
+@@ -204,16 +204,13 @@
+         @param st: the string to parse
+         @return: a document object
+         """
++        if type(st) == unicode:
++            try:
++                enc = kwargs['char_encoding']
++            except KeyError:
++                enc = 'utf8'
++                kwargs['char_encoding'] = enc
++            st = st.encode(enc)
+         doc = self._create(**kwargs)
+         self.loadString(doc, st)
+         return doc




More information about the Python-modules-commits mailing list