[Python-modules-commits] r31102 - in packages/beautifulsoup4/trunk/debian (4 files)

stefanor at users.alioth.debian.org stefanor at users.alioth.debian.org
Fri Oct 17 05:46:44 UTC 2014


    Date: Friday, October 17, 2014 @ 05:46:43
  Author: stefanor
Revision: 31102

Patch +python3.4-warnings: Squash new warnings under Python 3.4, fixing
the test suite, and preparing for Python 3.5. (Closes: #765142)

Added:
  packages/beautifulsoup4/trunk/debian/patches/
  packages/beautifulsoup4/trunk/debian/patches/python3.4-warnings
  packages/beautifulsoup4/trunk/debian/patches/series
Modified:
  packages/beautifulsoup4/trunk/debian/changelog

Modified: packages/beautifulsoup4/trunk/debian/changelog
===================================================================
--- packages/beautifulsoup4/trunk/debian/changelog	2014-10-16 23:44:08 UTC (rev 31101)
+++ packages/beautifulsoup4/trunk/debian/changelog	2014-10-17 05:46:43 UTC (rev 31102)
@@ -1,3 +1,10 @@
+beautifulsoup4 (4.3.2-2) UNRELEASED; urgency=medium
+
+  * Patch +python3.4-warnings: Squash new warnings under Python 3.4, fixing
+    the test suite, and preparing for Python 3.5. (Closes: #765142)
+
+ -- Stefano Rivera <stefanor at debian.org>  Sat, 03 May 2014 14:34:48 +0200
+
 beautifulsoup4 (4.3.2-1) unstable; urgency=low
 
   * New upstream release.

Added: packages/beautifulsoup4/trunk/debian/patches/python3.4-warnings
===================================================================
--- packages/beautifulsoup4/trunk/debian/patches/python3.4-warnings	                        (rev 0)
+++ packages/beautifulsoup4/trunk/debian/patches/python3.4-warnings	2014-10-17 05:46:43 UTC (rev 31102)
@@ -0,0 +1,46 @@
+Description: Avoid warnings under Python 3.4
+ Python 3.5 is tidying up the HTMLParser module a bit, and 3.4 is raising some
+ warnings in preparation for the backwards-incompatible changes.
+ .
+ This squashes the warnings by specifically requesting the behaviour we want.
+ .
+ As there were tests, checking for an absense of warnings, this also gets the
+ test suite passing, again, under 3.4.
+Author: Stefano Rivera <stefanor at debian.org>
+Bug-Debian: https://bugs.debian.org/765142
+Bug-Upstream: https://bugs.launchpad.net/beautifulsoup/+bug/1375721
+Forwarded: https://code.launchpad.net/~stefanor/beautifulsoup/python3.4/+merge/238642
+
+--- a/bs4/builder/_htmlparser.py
++++ b/bs4/builder/_htmlparser.py
+@@ -19,10 +19,8 @@
+ # At the end of this file, we monkeypatch HTMLParser so that
+ # strict=True works well on Python 3.2.2.
+ major, minor, release = sys.version_info[:3]
+-CONSTRUCTOR_TAKES_STRICT = (
+-    major > 3
+-    or (major == 3 and minor > 2)
+-    or (major == 3 and minor == 2 and release >= 3))
++CONSTRUCTOR_TAKES_STRICT = major == 3 and minor == 2 and release >= 3
++CONSTRUCTOR_TAKES_CONVERT_CHARREFS = major == 3 and minor >= 4
+ 
+ from bs4.element import (
+     CData,
+@@ -63,7 +61,7 @@
+ 
+     def handle_charref(self, name):
+         # XXX workaround for a bug in HTMLParser. Remove this once
+-        # it's fixed.
++        # it's fixed. http://bugs.python.org/issue13633
+         if name.startswith('x'):
+             real_name = int(name.lstrip('x'), 16)
+         elif name.startswith('X'):
+@@ -133,6 +131,8 @@
+     def __init__(self, *args, **kwargs):
+         if CONSTRUCTOR_TAKES_STRICT:
+             kwargs['strict'] = False
++        if CONSTRUCTOR_TAKES_CONVERT_CHARREFS:
++            kwargs['convert_charrefs'] = False
+         self.parser_args = (args, kwargs)
+ 
+     def prepare_markup(self, markup, user_specified_encoding=None,

Added: packages/beautifulsoup4/trunk/debian/patches/series
===================================================================
--- packages/beautifulsoup4/trunk/debian/patches/series	                        (rev 0)
+++ packages/beautifulsoup4/trunk/debian/patches/series	2014-10-17 05:46:43 UTC (rev 31102)
@@ -0,0 +1 @@
+python3.4-warnings




More information about the Python-modules-commits mailing list