summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Suster <carl@contraflo.ws>2017-01-11 22:51:52 +1100
committerCarl Suster <carl@contraflo.ws>2017-01-11 22:51:52 +1100
commit54650b570eb48237c9e96165261779abf254a566 (patch)
tree4775d9d2e980ca6005cb7aafe26a0bd72d921c88
parent246844d7ebb1d5b7cf51f4a229c9dc7e536e1981 (diff)
Replace Python 3 hack with a proper patch
-rw-r--r--debian/changelog7
-rwxr-xr-xdebian/rules5
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@contraflo.ws> Wed, 11 Jan 2017 15:53:36 +1100
+ -- Carl Suster <carl@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
%: