[Python-modules-commits] [python-pynzb] 06/11: Replace Python 3 hack with a proper patch

Carl Suster arcresu-guest at moszumanska.debian.org
Thu Jan 12 00:43:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

arcresu-guest pushed a commit to branch master
in repository python-pynzb.

commit 54650b570eb48237c9e96165261779abf254a566
Author: Carl Suster <carl at contraflo.ws>
Date:   Wed Jan 11 22:51:52 2017 +1100

    Replace Python 3 hack with a proper patch
---
 debian/changelog | 7 ++++---
 debian/rules     | 5 -----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 57a8d8c..f3b3f5a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,12 +22,13 @@ python-pynzb (0.1.0-3) unstable; urgency=medium
     standard library XML parsers.
   * Build-Depend on lxml in order to run the test for the implementation of the
     NZB parser using lxml (LXMLNZBParser).
-  * For Python 3, add a command to PYBUILD_AFTTER_BUILD_python3 in d/rules to
-    change the code to decode strings -> bytes as utf-8 for lxml's benefit.
+  * 0003-give-lxml-etree-BytesIO-in-Python-3.patch: make the code Python 3
+    compatible by decoding strings -> bytes as UTF-8 and substituting BytesIO
+    for StringIO. This only affects the LXMLNZPParser.
   * Fix watch file and declare version 4 format.
   * Cleanup .egg-info files in d/clean and d/source/options.
 
- -- Carl Suster <carl at contraflo.ws>  Wed, 11 Jan 2017 15:53:36 +1100
+ -- Carl Suster <carl at contraflo.ws>  Wed, 11 Jan 2017 22:51:40 +1100
 
 python-pynzb (0.1.0-2) unstable; urgency=low
 
diff --git a/debian/rules b/debian/rules
index 68142db..dee803d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,11 +4,6 @@
 export PYBUILD_NAME=pynzb
 
 export PYBUILD_TEST_ARGS=pynzb/tests.py
-# lxml expects a bytes object in Python 3 so we simply decode the string as
-# utf-8 for the Python 3 build. If this turns out to be problematic, we can
-# instead disable lxml support for the Python 3 build in pynzb/__init__.py and
-# rely on the standard library fallbacks for XML parsing.
-export PYBUILD_AFTER_BUILD_python3=sed -i -e 's/StringIO/BytesIO/g' -e 's/BytesIO(xml)/BytesIO(bytes(xml,"utf-8"))/' {build_dir}/pynzb/lxml_nzb.py
 
 
 %:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pynzb.git



More information about the Python-modules-commits mailing list