summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2019-12-24 09:06:53 -0500
committerLeonard Richardson <leonardr@segfault.org>2019-12-24 09:06:53 -0500
commit11d1335989f5dde3b1c6b84f05bc6cf8a1fedd59 (patch)
treee43984bc5caea7469639ab001295c4f1c3233197
parentb7dec273425095f8e2ab1f1c58ecc124ca63e856 (diff)
Fixed deprecation warning. [bug=1855301]
-rw-r--r--CHANGELOG16
-rw-r--r--bs4/dammit.py2
2 files changed, 9 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a691583..261b576 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,18 +1,18 @@
= Unreleased
-* Fixed a deprecation warning on Python 3.7. Patch by Colin
- Watson. [bug=1847592]
-
* Added Python docstrings to most public methods.
-* The html.parser tree builder now correctly handles DOCTYPEs that are
- not uppercase. [bug=1848401]
-
* Added a Chinese translation by Deron Wang and a Brazilian Portuguese
translation by Cezar Peixeiro to the repository.
-* PageElement.select() now returns a ResultSet rather than a regular list,
- making it consistent with methods like find_all().
+* Fixed two deprecation warnings. Patches by Colin
+ Watson and Nicholas Neumann. [bug=1847592] [bug=1855301]
+
+* The html.parser tree builder now correctly handles DOCTYPEs that are
+ not uppercase. [bug=1848401]
+
+* PageElement.select() now returns a ResultSet rather than a regular
+ list, making it consistent with methods like find_all().
= 4.8.1 (20191006)
diff --git a/bs4/dammit.py b/bs4/dammit.py
index e72a867..eb08568 100644
--- a/bs4/dammit.py
+++ b/bs4/dammit.py
@@ -53,7 +53,7 @@ except ImportError:
# Build bytestring and Unicode versions of regular expressions for finding
# a declared encoding inside an XML or HTML document.
-xml_encoding = u'^\s*<\\?.*encoding=[\'"](.*?)[\'"].*\\?>'
+xml_encoding = u'^\\s*<\\?.*encoding=[\'"](.*?)[\'"].*\\?>'
html_meta = u'<\\s*meta[^>]+charset\\s*=\\s*["\']?([^>]*?)[ /;\'">]'
encoding_res = dict()
encoding_res[bytes] = {