[Python-modules-commits] [python-pynzb] 10/11: merge patched into master
Carl Suster
arcresu-guest at moszumanska.debian.org
Thu Jan 12 00:43:28 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 f5b7b40591e466351412987ed4ad0b90167f8547
Merge: 192a9f9 591e67b
Author: Carl Suster <carl at contraflo.ws>
Date: Wed Jan 11 23:13:59 2017 +1100
merge patched into master
debian/.git-dpm | 4 ++--
debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch | 6 +++---
pynzb/lxml_nzb.py | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --cc debian/.git-dpm
index 3b2ef42,0000000..f93cbbb
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,8 @@@
+# see git-dpm(1) from git-dpm package
- 351c51b882bf00d1db03de5a2419372e2e31d6cf
- 351c51b882bf00d1db03de5a2419372e2e31d6cf
++591e67b26a2d694d5aae2d77985eab4d8daf2d9e
++591e67b26a2d694d5aae2d77985eab4d8daf2d9e
+124074ce42e5d83c71e028a8757afb392cc96548
+124074ce42e5d83c71e028a8757afb392cc96548
+python-pynzb_0.1.0.orig.tar.gz
+cf39d7f32c15f281ab81b0043b4068d101a2cd1f
+5598
diff --cc debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch
index 32746fd,0000000..aac136f
mode 100644,000000..100644
--- a/debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch
+++ b/debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch
@@@ -1,40 -1,0 +1,40 @@@
- From 351c51b882bf00d1db03de5a2419372e2e31d6cf Mon Sep 17 00:00:00 2001
++From 591e67b26a2d694d5aae2d77985eab4d8daf2d9e Mon Sep 17 00:00:00 2001
+From: Carl Suster <carl at contraflo.ws>
+Date: Wed, 11 Jan 2017 22:34:34 +1100
+Subject: give lxml etree BytesIO in Python 3
+
+The lxml etree API changed in Python 3 to take BytesIO instead of
+StringIO. This patch maintains the original behaviour in Python 2 but
+switches to BytesIO in Python 3, decoding the XML data as UTF-8.
+---
+ pynzb/lxml_nzb.py | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/pynzb/lxml_nzb.py b/pynzb/lxml_nzb.py
- index 790671d..9d76c4a 100644
++index 790671d..e74ba34 100644
+--- a/pynzb/lxml_nzb.py
++++ b/pynzb/lxml_nzb.py
+@@ -6,11 +6,17 @@ except ImportError:
+ raise ImportError("You must have lxml installed before you can use the " +
+ "lxml NZB parser.")
+
+-try:
+- from cStringIO import StringIO
+-except ImportError:
+- from StringIO import StringIO
++import sys
++if sys.version_info.major < 3:
++ try:
++ from cStringIO import StringIO
++ except ImportError:
++ from StringIO import StringIO
++ def as_io(xml): return StringIO(xml)
++else:
- + from BytesIO import BytesIO
+++ from io import BytesIO
++ def as_io(xml): return BytesIO(bytes(xml, 'utf-8'))
+
+ class LXMLNZBParser(BaseETreeNZBParser):
+ def get_etree_iter(self, xml, et=etree):
+- return iter(et.iterparse(StringIO(xml), events=("start", "end")))
+\ No newline at end of file
++ return iter(et.iterparse(as_io(xml), events=("start", "end")))
--
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