Bugs item #1637850, was opened at 2007-01-17 11:22 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1637850&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: y-unno (y-unno) >Assigned to: Raymond Hettinger (rhettinger) Summary: make_table in difflib does not work with unicode Initial Comment: make_table function in difflib.HtmlDiff does not work correctly when input strings are unicode. This is because the library uses cStringIO.StringIO classes, and cStringIO.StringIO returns strings encoded by the default encoding. When the default encoding is 'ascii', for example, this behaviour becomes a problem because some unicode characters cannot be encoded in 'ascii'. So, please change cStringIO to StringIO in difflib.py. When I use StringIO in difflib.py, this function returns unicode strings and no problems occured. This problem occured in Python 2.5/2.4 on Windows XP. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2007-03-08 16:35 Message: Logged In: YES user_id=80475 Originator: NO Fixed in revs 54229 and 54230. It wasn't necessary to use StringIO at all. A simple list of strings and join works fine (and handles unicode transparently). ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2007-01-17 16:13 Message: Logged In: YES user_id=849994 Originator: NO I don't know. Perhaps we should rather fix cStringIO to accept Unicode strings. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1637850&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com