[Python-modules-commits] [feedparser] 01/01: Convert from git-dpm to gbp

Carl Suster arcresu-guest at moszumanska.debian.org
Fri Dec 1 13:43:11 UTC 2017


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

arcresu-guest pushed a commit to branch debian/master
in repository feedparser.

commit 8a9f8929ac81804b12a240c9008b347c632b1bc4
Author: Carl Suster <carl at contraflo.ws>
Date:   Sat Dec 2 00:42:10 2017 +1100

    Convert from git-dpm to gbp
---
 debian/.git-dpm                      | 11 -----------
 debian/changelog                     |  1 +
 debian/gbp.conf                      |  2 ++
 debian/patches/python3-auth.patch    |  1 -
 debian/patches/redirect-status.patch |  1 -
 debian/patches/sgmllib3.patch        |  1 -
 feedparser/feedparser.py             | 29 ++++++++++-------------------
 feedparser/feedparsertest.py         |  2 +-
 8 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/debian/.git-dpm b/debian/.git-dpm
deleted file mode 100644
index 9d79ae5..0000000
--- a/debian/.git-dpm
+++ /dev/null
@@ -1,11 +0,0 @@
-# see git-dpm(1) from git-dpm package
-0c76e5e55b9f703f65c558d5bb563793b0bcfa7c
-0c76e5e55b9f703f65c558d5bb563793b0bcfa7c
-7d66b9186f925b42eef8928fec7c73fa0379e089
-7d66b9186f925b42eef8928fec7c73fa0379e089
-feedparser_5.2.1.orig.tar.bz2
-2787705bedc2c760d96bf47d8aed30e30269ed64
-192328
-debianTag="debian/%e%v"
-patchedTag="patched/%e%v"
-upstreamTag="upstream/%e%u"
diff --git a/debian/changelog b/debian/changelog
index 2407c31..b6edf20 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ feedparser (5.2.1-1) UNRELEASED; urgency=medium
 
   [ Carl Suster ]
   * Fixed upstream URL googlecode -> github
+  * Convert from git-dpm to gbp
 
  -- Jackson Doak <noskcaj at ubuntu.com>  Wed, 05 Aug 2015 07:41:38 +1000
 
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..3879982
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch=debian/master
diff --git a/debian/patches/python3-auth.patch b/debian/patches/python3-auth.patch
index 8eefc5f..248b1ae 100644
--- a/debian/patches/python3-auth.patch
+++ b/debian/patches/python3-auth.patch
@@ -1,4 +1,3 @@
-From 0c76e5e55b9f703f65c558d5bb563793b0bcfa7c Mon Sep 17 00:00:00 2001
 From: Etienne Millon <me at emillon.org>
 Date: Sun, 11 Oct 2015 11:59:07 +0200
 Subject: Fix HTTP auth in Python 3
diff --git a/debian/patches/redirect-status.patch b/debian/patches/redirect-status.patch
index 2875658..35b64e8 100644
--- a/debian/patches/redirect-status.patch
+++ b/debian/patches/redirect-status.patch
@@ -1,4 +1,3 @@
-From 34ca1def9c7ed55a1dfc85bba08534d367e54552 Mon Sep 17 00:00:00 2001
 From: "jikamens at gmail.com" <jikamens at gmail.com>
 Date: Sun, 11 Oct 2015 11:59:06 +0200
 Subject: Fix status reported for redirections
diff --git a/debian/patches/sgmllib3.patch b/debian/patches/sgmllib3.patch
index fcd18d6..b055c7f 100644
--- a/debian/patches/sgmllib3.patch
+++ b/debian/patches/sgmllib3.patch
@@ -1,4 +1,3 @@
-From 20e10be93caf77cf75fff5c5efbeae077ae2454f Mon Sep 17 00:00:00 2001
 From: Barry Warsaw <barry at python.org>
 Date: Sun, 11 Oct 2015 11:59:05 +0200
 Subject: Python 3 does not ship an sgmllib.py module.  Upstream feedparser
diff --git a/feedparser/feedparser.py b/feedparser/feedparser.py
index ed7c462..999cb0d 100644
--- a/feedparser/feedparser.py
+++ b/feedparser/feedparser.py
@@ -192,30 +192,22 @@ else:
 
 # sgmllib is not available by default in Python 3; if the end user doesn't have
 # it available then we'll lose illformed XML parsing and content santizing
-_SGML_AVAILABLE = 0
 try:
     import sgmllib
 except ImportError:
-    # Debian installs the upstream sgmllib3.py into this location.
-    try:
-        import feedparser_sgmllib3 as sgmllib
-    except ImportError:
-        # This is probably Python 3, which doesn't include sgmllib anymore
-        _SGML_AVAILABLE = 0
+    # This is probably Python 3, which doesn't include sgmllib anymore
+    _SGML_AVAILABLE = 0
 
-        # Mock sgmllib enough to allow subclassing later on
-        class sgmllib(object):
-            class SGMLParser(object):
-                def goahead(self, i):
-                    pass
-                def parse_starttag(self, i):
-                    pass
-    else:
-        _SGML_AVAILABLE = 1
+    # Mock sgmllib enough to allow subclassing later on
+    class sgmllib(object):
+        class SGMLParser(object):
+            def goahead(self, i):
+                pass
+            def parse_starttag(self, i):
+                pass
 else:
     _SGML_AVAILABLE = 1
 
-if _SGML_AVAILABLE:
     # sgmllib defines a number of module-level regular expressions that are
     # insufficient for the XML parsing feedparser needs. Rather than modify
     # the variables directly in sgmllib, they're defined here using the same
@@ -2860,7 +2852,7 @@ def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, h
                 user_passwd, realhost = urllib.splituser(realhost)
                 if user_passwd:
                     url_file_stream_or_string = '%s://%s%s' % (urltype, realhost, rest)
-                    auth = base64.standard_b64encode(user_passwd.encode('ascii')).strip().decode('ascii')
+                    auth = base64.standard_b64encode(user_passwd).strip()
 
         # iri support
         if isinstance(url_file_stream_or_string, unicode):
@@ -3923,7 +3915,6 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer
 
     # Stop processing if the server sent HTTP 304 Not Modified.
     if getattr(f, 'code', 0) == 304:
-        result['status'] = 304
         result['version'] = u''
         result['debug_message'] = 'The feed has not changed since you last checked, ' + \
             'so the server sent no data.  This is a feature, not a bug!'
diff --git a/feedparser/feedparsertest.py b/feedparser/feedparsertest.py
index 4195a1f..8706d64 100644
--- a/feedparser/feedparsertest.py
+++ b/feedparser/feedparsertest.py
@@ -520,7 +520,7 @@ class TestHTTPStatus(unittest.TestCase):
         u = 'http://localhost:8097/tests/http/http_redirect_to_304.xml'
         f = feedparser.parse(u)
         self.assertTrue(f.bozo == 0)
-        self.assertTrue(f.status == 304)
+        self.assertTrue(f.status == 302)
 
 class TestDateParsers(unittest.TestCase):
     "Test the various date parsers; most of the test cases are constructed " \

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



More information about the Python-modules-commits mailing list