From 4184cece4a0b2d04b45105e755492bfee5fa1a12 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Mon, 7 Sep 2015 23:13:04 +0200 Subject: [PATCH] [fix] duckduckgo unicode url - #419 --- searx/engines/duckduckgo.py | 2 +- searx/tests/engines/test_duckduckgo.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py index f18f3b446..4ac2099ae 100644 --- a/searx/engines/duckduckgo.py +++ b/searx/engines/duckduckgo.py @@ -72,7 +72,7 @@ def response(resp): # append result results.append({'title': title, 'content': content, - 'url': res_url.encode('utf8')}) + 'url': res_url}) # return results return results diff --git a/searx/tests/engines/test_duckduckgo.py b/searx/tests/engines/test_duckduckgo.py index 6f085cbc2..14cd9cd87 100644 --- a/searx/tests/engines/test_duckduckgo.py +++ b/searx/tests/engines/test_duckduckgo.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from collections import defaultdict import mock from searx.engines import duckduckgo @@ -30,7 +31,7 @@ class TestDuckduckgoEngine(SearxTestCase): response = mock.Mock(text='') self.assertEqual(duckduckgo.response(response), []) - html = """ + html = u"""