[Python-modules-commits] r21708 - in packages/python-docutils/trunk/debian (3 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Fri May 11 21:42:10 UTC 2012


    Date: Friday, May 11, 2012 @ 21:42:09
  Author: jwilk
Revision: 21708

Cherry-pick upstream patch to fix encoding issues with the include directive.

Added:
  packages/python-docutils/trunk/debian/patches/parsers.rst.directives.misc-encoding.diff
Modified:
  packages/python-docutils/trunk/debian/changelog
  packages/python-docutils/trunk/debian/patches/series

Modified: packages/python-docutils/trunk/debian/changelog
===================================================================
--- packages/python-docutils/trunk/debian/changelog	2012-05-11 16:20:19 UTC (rev 21707)
+++ packages/python-docutils/trunk/debian/changelog	2012-05-11 21:42:09 UTC (rev 21708)
@@ -21,8 +21,10 @@
     header.
   * Remove convenience copy of the roman module. Build-Depend on python-roman
     and python3-roman.
+  * Cherry-pick upstream patch to fix encoding issues with the include
+    directive. (parsers.rst.directives.misc-encoding.diff)
 
- -- Jakub Wilk <jwilk at debian.org>  Fri, 11 May 2012 17:05:53 +0200
+ -- Jakub Wilk <jwilk at debian.org>  Fri, 11 May 2012 23:39:45 +0200
 
 python-docutils (0.8.1-6) unstable; urgency=low
 

Added: packages/python-docutils/trunk/debian/patches/parsers.rst.directives.misc-encoding.diff
===================================================================
--- packages/python-docutils/trunk/debian/patches/parsers.rst.directives.misc-encoding.diff	                        (rev 0)
+++ packages/python-docutils/trunk/debian/patches/parsers.rst.directives.misc-encoding.diff	2012-05-11 21:42:09 UTC (rev 21708)
@@ -0,0 +1,52 @@
+Description: fix encoding issues with the include directive
+Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils?view=revision&revision=7433
+Last-Update: 2012-05-11
+
+--- a/docutils/parsers/rst/directives/misc.py
++++ b/docutils/parsers/rst/directives/misc.py
+@@ -73,6 +73,11 @@
+                 error_handler=(self.state.document.settings.\
+                                input_encoding_error_handler),
+                 handle_io_errors=None)
++        except UnicodeEncodeError, error:
++            raise self.severe(u'Problems with "%s" directive path:\n'
++                              'Cannot encode input file path "%s" '
++                              '(wrong locale?).' %
++                              (self.name, SafeString(path)))
+         except IOError, error:
+             raise self.severe(u'Problems with "%s" directive path:\n%s.' %
+                       (self.name, ErrorString(error)))
+--- a/test/test_parsers/test_rst/test_directives/test_include.py
++++ b/test/test_parsers/test_rst/test_directives/test_include.py
+@@ -50,6 +50,18 @@
+ nonexistent_rel = DocutilsTestSupport.utils.relative_path(
+     os.path.join(DocutilsTestSupport.testroot, 'dummy'), nonexistent)
+ 
++# Different error for path with 8bit chars with locale == C or None:
++try:
++    open(u'\u043c\u0438\u0440.txt')
++except UnicodeEncodeError:
++    errstr_8bit_path = u"""\
++Cannot encode input file path "\u043c\u0438\u0440.txt" (wrong locale?).\
++"""
++except:
++    errstr_8bit_path = u"""\
++InputError: [Errno 2] No such file or directory: '\u043c\u0438\u0440.txt'.\
++"""
++
+ totest = {}
+ 
+ totest['include'] = [
+@@ -414,10 +426,10 @@
+     <system_message level="4" line="3" source="test data" type="SEVERE">
+         <paragraph>
+             Problems with "include" directive path:
+-            InputError: [Errno 2] No such file or directory: '\u043c\u0438\u0440.txt'.
++            %s
+         <literal_block xml:space="preserve">
+             .. include:: \u043c\u0438\u0440.txt
+-"""],
++""" % errstr_8bit_path],
+ ["""\
+ Testing errors in included file:
+ 

Modified: packages/python-docutils/trunk/debian/patches/series
===================================================================
--- packages/python-docutils/trunk/debian/patches/series	2012-05-11 16:20:19 UTC (rev 21707)
+++ packages/python-docutils/trunk/debian/patches/series	2012-05-11 21:42:09 UTC (rev 21708)
@@ -3,5 +3,6 @@
 emacs-sensible-browser.diff
 testall-no-stdout-stderr-redirect.diff
 no-test-skipping.diff
+parsers.rst.directives.misc-encoding.diff
 move-data-to-usr-share.diff
 # dep8.diff




More information about the Python-modules-commits mailing list