From fce671c89949ebb293fb4fa9bc832be54d72d445 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 28 Aug 2014 00:00:16 +0200 Subject: [PATCH] Patch for an Issue #801 --- lib/core/common.py | 2 ++ thirdparty/clientform/clientform.py | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/core/common.py b/lib/core/common.py index cbf92ccce..245763b9b 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3337,6 +3337,8 @@ def findPageForms(content, url, raise_=False, addToTargets=False): try: forms = ParseResponse(response, backwards_compat=False) + except UnicodeError: + pass except ParseError: warnMsg = "badly formed HTML at the given URL ('%s'). Going to filter it" % url logger.warning(warnMsg) diff --git a/thirdparty/clientform/clientform.py b/thirdparty/clientform/clientform.py index 0169c5aaf..3ac1534f5 100644 --- a/thirdparty/clientform/clientform.py +++ b/thirdparty/clientform/clientform.py @@ -1124,6 +1124,7 @@ def _ParseFileEx(file, base_uri, if action is None: action = base_uri else: + action = unicode(action, "utf8") if action and not isinstance(action, unicode) else action action = _urljoin(base_uri, action) # would be nice to make HTMLForm class (form builder) pluggable form = HTMLForm(