[Python-modules-commits] r21020 - in packages/sphinx/trunk/debian (3 files)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Mon Apr 2 19:58:17 UTC 2012
Date: Monday, April 2, 2012 @ 19:58:12
Author: jwilk
Revision: 21020
Fix Unicode issues in PygmentsBridge.highlight_block().
Added:
packages/sphinx/trunk/debian/patches/pygments_byte_strings.diff
Modified:
packages/sphinx/trunk/debian/changelog
packages/sphinx/trunk/debian/patches/series
Modified: packages/sphinx/trunk/debian/changelog
===================================================================
--- packages/sphinx/trunk/debian/changelog 2012-04-02 19:34:00 UTC (rev 21019)
+++ packages/sphinx/trunk/debian/changelog 2012-04-02 19:58:12 UTC (rev 21020)
@@ -3,8 +3,11 @@
* Validate *.po files at build time.
* Add fix_nepali_po.diff: remove Nepali translations that must have been
wrong.
+ * Add pygments_byte_strings.diff: fix Unicode issues in
+ PygmentsBridge.highlight_block (closes: #660930). Thanks to Anton Gladky
+ for the bug report and the initial patch.
- -- Jakub Wilk <jwilk at debian.org> Sun, 25 Mar 2012 11:56:09 +0200
+ -- Jakub Wilk <jwilk at debian.org> Mon, 02 Apr 2012 21:49:20 +0200
sphinx (1.1.3+dfsg-2) unstable; urgency=low
Added: packages/sphinx/trunk/debian/patches/pygments_byte_strings.diff
===================================================================
--- packages/sphinx/trunk/debian/patches/pygments_byte_strings.diff (rev 0)
+++ packages/sphinx/trunk/debian/patches/pygments_byte_strings.diff 2012-04-02 19:58:12 UTC (rev 21020)
@@ -0,0 +1,19 @@
+Description: Fix Unicode issues in PygmentsBridge.highlight_block()
+ In some circumstances pygments.highlight() returns a byte string instead of
+ Unicode string. PygmentsBridge.highlight_block() does expect Unicode strings
+ only, so convert such strings forcibly to Unicode.
+Bug-Debian: http://bugs.debian.org/660930
+Bug: https://bitbucket.org/birkenfeld/sphinx/issue/905/typeerror-expected-a-character-buffer
+Author: Anton Gladky <gladky.anton at gmail.com>
+Last-Update: 2012-04-02
+
+--- a/sphinx/highlighting.py
++++ b/sphinx/highlighting.py
+@@ -204,6 +204,7 @@
+ try:
+ formatter = self.get_formatter(**kwargs)
+ hlsource = highlight(source, lexer, formatter)
++ hlsource = unicode(hlsource)
+ if self.dest == 'html':
+ return hlsource
+ else:
Modified: packages/sphinx/trunk/debian/patches/series
===================================================================
--- packages/sphinx/trunk/debian/patches/series 2012-04-02 19:34:00 UTC (rev 21019)
+++ packages/sphinx/trunk/debian/patches/series 2012-04-02 19:58:12 UTC (rev 21020)
@@ -6,3 +6,4 @@
python3_test_build_dir.diff
skiptest_latex.diff
fix_nepali_po.diff
+pygments_byte_strings.diff
More information about the Python-modules-commits
mailing list