We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
wolframalpha engine is broken
The wolframalpha engine appears to be broken in 0.15.0
```
searx-run[9330]: ERROR:searx.search:engine wolframalpha : exception : Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
searx-run[9330]: Traceback (most recent call last):
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py", line 104, in search_one_request_safe
searx-run[9330]:     search_results = search_one_request(engine, query, request_params)
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py", line 87, in search_one_request
searx-run[9330]:     return engine.response(response)
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/engines/wolframalpha_api.py", line 68, in response
searx-run[9330]:     search_results = etree.XML(resp.text)
searx-run[9330]:   File "src/lxml/etree.pyx", line 3192, in lxml.etree.XML
searx-run[9330]:   File "src/lxml/parser.pxi", line 1872, in lxml.etree._parseMemoryDocument
searx-run[9330]: ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
```
wolframalpha engine is broken
The wolframalpha engine appears to be broken in 0.15.0
```
searx-run[9330]: ERROR:searx.search:engine wolframalpha : exception : Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
searx-run[9330]: Traceback (most recent call last):
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py", line 104, in search_one_request_safe
searx-run[9330]:     search_results = search_one_request(engine, query, request_params)
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py", line 87, in search_one_request
searx-run[9330]:     return engine.response(response)
searx-run[9330]:   File "/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/engines/wolframalpha_api.py", line 68, in response
searx-run[9330]:     search_results = etree.XML(resp.text)
searx-run[9330]:   File "src/lxml/etree.pyx", line 3192, in lxml.etree.XML
searx-run[9330]:   File "src/lxml/parser.pxi", line 1872, in lxml.etree._parseMemoryDocument
searx-run[9330]: ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `searx/engines/wolframalpha_api.py`
Content:
```
1 # Wolfram Alpha (Science)
2 #
3 # @website     https://www.wolframalpha.com
4 # @provide-api yes (https://api.wolframalpha.com/v2/)
5 #
6 # @using-api   yes
7 # @results     XML
8 # @stable      yes
9 # @parse       url, infobox
10 
11 from lxml import etree
12 from searx.url_utils import urlencode
13 
14 # search-url
15 search_url = 'https://api.wolframalpha.com/v2/query?appid={api_key}&{query}'
16 site_url = 'https://www.wolframalpha.com/input/?{query}'
17 api_key = ''  # defined in settings.yml
18 
19 # xpath variables
20 failure_xpath = '/queryresult[attribute::success="false"]'
21 input_xpath = '//pod[starts-with(attribute::id, "Input")]/subpod/plaintext'
22 pods_xpath = '//pod'
23 subpods_xpath = './subpod'
24 pod_primary_xpath = './@primary'
25 pod_id_xpath = './@id'
26 pod_title_xpath = './@title'
27 plaintext_xpath = './plaintext'
28 image_xpath = './img'
29 img_src_xpath = './@src'
30 img_alt_xpath = './@alt'
31 
32 # pods to display as image in infobox
33 # this pods do return a plaintext, but they look better and are more useful as images
34 image_pods = {'VisualRepresentation',
35               'Illustration'}
36 
37 
38 # do search-request
39 def request(query, params):
40     params['url'] = search_url.format(query=urlencode({'input': query}), api_key=api_key)
41     params['headers']['Referer'] = site_url.format(query=urlencode({'i': query}))
42 
43     return params
44 
45 
46 # replace private user area characters to make text legible
47 def replace_pua_chars(text):
48     pua_chars = {u'\uf522': u'\u2192',  # rigth arrow
49                  u'\uf7b1': u'\u2115',  # set of natural numbers
50                  u'\uf7b4': u'\u211a',  # set of rational numbers
51                  u'\uf7b5': u'\u211d',  # set of real numbers
52                  u'\uf7bd': u'\u2124',  # set of integer numbers
53                  u'\uf74c': 'd',        # differential
54                  u'\uf74d': u'\u212f',  # euler's number
55                  u'\uf74e': 'i',        # imaginary number
56                  u'\uf7d9': '='}        # equals sign
57 
58     for k, v in pua_chars.items():
59         text = text.replace(k, v)
60 
61     return text
62 
63 
64 # get response from search-request
65 def response(resp):
66     results = []
67 
68     search_results = etree.XML(resp.text)
69 
70     # return empty array if there are no results
71     if search_results.xpath(failure_xpath):
72         return []
73 
74     try:
75         infobox_title = search_results.xpath(input_xpath)[0].text
76     except:
77         infobox_title = ""
78 
79     pods = search_results.xpath(pods_xpath)
80     result_chunks = []
81     result_content = ""
82     for pod in pods:
83         pod_id = pod.xpath(pod_id_xpath)[0]
84         pod_title = pod.xpath(pod_title_xpath)[0]
85         pod_is_result = pod.xpath(pod_primary_xpath)
86 
87         subpods = pod.xpath(subpods_xpath)
88         if not subpods:
89             continue
90 
91         # Appends either a text or an image, depending on which one is more suitable
92         for subpod in subpods:
93             content = subpod.xpath(plaintext_xpath)[0].text
94             image = subpod.xpath(image_xpath)
95 
96             if content and pod_id not in image_pods:
97 
98                 if pod_is_result or not result_content:
99                     if pod_id != "Input":
100                         result_content = "%s: %s" % (pod_title, content)
101 
102                 # if no input pod was found, title is first plaintext pod
103                 if not infobox_title:
104                     infobox_title = content
105 
106                 content = replace_pua_chars(content)
107                 result_chunks.append({'label': pod_title, 'value': content})
108 
109             elif image:
110                 result_chunks.append({'label': pod_title,
111                                       'image': {'src': image[0].xpath(img_src_xpath)[0],
112                                                 'alt': image[0].xpath(img_alt_xpath)[0]}})
113 
114     if not result_chunks:
115         return []
116 
117     title = "Wolfram|Alpha (%s)" % infobox_title
118 
119     # append infobox
120     results.append({'infobox': infobox_title,
121                     'attributes': result_chunks,
122                     'urls': [{'title': 'Wolfram|Alpha', 'url': resp.request.headers['Referer']}]})
123 
124     # append link to site
125     results.append({'url': resp.request.headers['Referer'],
126                     'title': title,
127                     'content': result_content})
128 
129     return results
130
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py
--- a/searx/engines/wolframalpha_api.py
+++ b/searx/engines/wolframalpha_api.py
@@ -65,7 +65,7 @@
 def response(resp):
     results = []
 
-    search_results = etree.XML(resp.text)
+    search_results = etree.XML(resp.content)
 
     # return empty array if there are no results
     if search_results.xpath(failure_xpath):

{"golden_diff": "diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py\n--- a/searx/engines/wolframalpha_api.py\n+++ b/searx/engines/wolframalpha_api.py\n@@ -65,7 +65,7 @@\n def response(resp):\n     results = []\n \n-    search_results = etree.XML(resp.text)\n+    search_results = etree.XML(resp.content)\n \n     # return empty array if there are no results\n     if search_results.xpath(failure_xpath):\n", "issue": "wolframalpha engine is broken\nThe wolframalpha engine appears to be broken in 0.15.0\r\n```\r\nsearx-run[9330]: ERROR:searx.search:engine wolframalpha : exception : Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.\r\nsearx-run[9330]: Traceback (most recent call last):\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py\", line 104, in search_one_request_safe\r\nsearx-run[9330]:     search_results = search_one_request(engine, query, request_params)\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py\", line 87, in search_one_request\r\nsearx-run[9330]:     return engine.response(response)\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/engines/wolframalpha_api.py\", line 68, in response\r\nsearx-run[9330]:     search_results = etree.XML(resp.text)\r\nsearx-run[9330]:   File \"src/lxml/etree.pyx\", line 3192, in lxml.etree.XML\r\nsearx-run[9330]:   File \"src/lxml/parser.pxi\", line 1872, in lxml.etree._parseMemoryDocument\r\nsearx-run[9330]: ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.\r\n```\nwolframalpha engine is broken\nThe wolframalpha engine appears to be broken in 0.15.0\r\n```\r\nsearx-run[9330]: ERROR:searx.search:engine wolframalpha : exception : Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.\r\nsearx-run[9330]: Traceback (most recent call last):\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py\", line 104, in search_one_request_safe\r\nsearx-run[9330]:     search_results = search_one_request(engine, query, request_params)\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/search.py\", line 87, in search_one_request\r\nsearx-run[9330]:     return engine.response(response)\r\nsearx-run[9330]:   File \"/nix/store/rf8v47ispmh7bp0rbl291ml1fivfs424-searx-0.15.0/lib/python3.6/site-packages/searx/engines/wolframalpha_api.py\", line 68, in response\r\nsearx-run[9330]:     search_results = etree.XML(resp.text)\r\nsearx-run[9330]:   File \"src/lxml/etree.pyx\", line 3192, in lxml.etree.XML\r\nsearx-run[9330]:   File \"src/lxml/parser.pxi\", line 1872, in lxml.etree._parseMemoryDocument\r\nsearx-run[9330]: ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.\r\n```\n", "before_files": [{"content": "# Wolfram Alpha (Science)\n#\n# @website     https://www.wolframalpha.com\n# @provide-api yes (https://api.wolframalpha.com/v2/)\n#\n# @using-api   yes\n# @results     XML\n# @stable      yes\n# @parse       url, infobox\n\nfrom lxml import etree\nfrom searx.url_utils import urlencode\n\n# search-url\nsearch_url = 'https://api.wolframalpha.com/v2/query?appid={api_key}&{query}'\nsite_url = 'https://www.wolframalpha.com/input/?{query}'\napi_key = ''  # defined in settings.yml\n\n# xpath variables\nfailure_xpath = '/queryresult[attribute::success=\"false\"]'\ninput_xpath = '//pod[starts-with(attribute::id, \"Input\")]/subpod/plaintext'\npods_xpath = '//pod'\nsubpods_xpath = './subpod'\npod_primary_xpath = './@primary'\npod_id_xpath = './@id'\npod_title_xpath = './@title'\nplaintext_xpath = './plaintext'\nimage_xpath = './img'\nimg_src_xpath = './@src'\nimg_alt_xpath = './@alt'\n\n# pods to display as image in infobox\n# this pods do return a plaintext, but they look better and are more useful as images\nimage_pods = {'VisualRepresentation',\n              'Illustration'}\n\n\n# do search-request\ndef request(query, params):\n    params['url'] = search_url.format(query=urlencode({'input': query}), api_key=api_key)\n    params['headers']['Referer'] = site_url.format(query=urlencode({'i': query}))\n\n    return params\n\n\n# replace private user area characters to make text legible\ndef replace_pua_chars(text):\n    pua_chars = {u'\\uf522': u'\\u2192',  # rigth arrow\n                 u'\\uf7b1': u'\\u2115',  # set of natural numbers\n                 u'\\uf7b4': u'\\u211a',  # set of rational numbers\n                 u'\\uf7b5': u'\\u211d',  # set of real numbers\n                 u'\\uf7bd': u'\\u2124',  # set of integer numbers\n                 u'\\uf74c': 'd',        # differential\n                 u'\\uf74d': u'\\u212f',  # euler's number\n                 u'\\uf74e': 'i',        # imaginary number\n                 u'\\uf7d9': '='}        # equals sign\n\n    for k, v in pua_chars.items():\n        text = text.replace(k, v)\n\n    return text\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    search_results = etree.XML(resp.text)\n\n    # return empty array if there are no results\n    if search_results.xpath(failure_xpath):\n        return []\n\n    try:\n        infobox_title = search_results.xpath(input_xpath)[0].text\n    except:\n        infobox_title = \"\"\n\n    pods = search_results.xpath(pods_xpath)\n    result_chunks = []\n    result_content = \"\"\n    for pod in pods:\n        pod_id = pod.xpath(pod_id_xpath)[0]\n        pod_title = pod.xpath(pod_title_xpath)[0]\n        pod_is_result = pod.xpath(pod_primary_xpath)\n\n        subpods = pod.xpath(subpods_xpath)\n        if not subpods:\n            continue\n\n        # Appends either a text or an image, depending on which one is more suitable\n        for subpod in subpods:\n            content = subpod.xpath(plaintext_xpath)[0].text\n            image = subpod.xpath(image_xpath)\n\n            if content and pod_id not in image_pods:\n\n                if pod_is_result or not result_content:\n                    if pod_id != \"Input\":\n                        result_content = \"%s: %s\" % (pod_title, content)\n\n                # if no input pod was found, title is first plaintext pod\n                if not infobox_title:\n                    infobox_title = content\n\n                content = replace_pua_chars(content)\n                result_chunks.append({'label': pod_title, 'value': content})\n\n            elif image:\n                result_chunks.append({'label': pod_title,\n                                      'image': {'src': image[0].xpath(img_src_xpath)[0],\n                                                'alt': image[0].xpath(img_alt_xpath)[0]}})\n\n    if not result_chunks:\n        return []\n\n    title = \"Wolfram|Alpha (%s)\" % infobox_title\n\n    # append infobox\n    results.append({'infobox': infobox_title,\n                    'attributes': result_chunks,\n                    'urls': [{'title': 'Wolfram|Alpha', 'url': resp.request.headers['Referer']}]})\n\n    # append link to site\n    results.append({'url': resp.request.headers['Referer'],\n                    'title': title,\n                    'content': result_content})\n\n    return results\n", "path": "searx/engines/wolframalpha_api.py"}], "after_files": [{"content": "# Wolfram Alpha (Science)\n#\n# @website     https://www.wolframalpha.com\n# @provide-api yes (https://api.wolframalpha.com/v2/)\n#\n# @using-api   yes\n# @results     XML\n# @stable      yes\n# @parse       url, infobox\n\nfrom lxml import etree\nfrom searx.url_utils import urlencode\n\n# search-url\nsearch_url = 'https://api.wolframalpha.com/v2/query?appid={api_key}&{query}'\nsite_url = 'https://www.wolframalpha.com/input/?{query}'\napi_key = ''  # defined in settings.yml\n\n# xpath variables\nfailure_xpath = '/queryresult[attribute::success=\"false\"]'\ninput_xpath = '//pod[starts-with(attribute::id, \"Input\")]/subpod/plaintext'\npods_xpath = '//pod'\nsubpods_xpath = './subpod'\npod_primary_xpath = './@primary'\npod_id_xpath = './@id'\npod_title_xpath = './@title'\nplaintext_xpath = './plaintext'\nimage_xpath = './img'\nimg_src_xpath = './@src'\nimg_alt_xpath = './@alt'\n\n# pods to display as image in infobox\n# this pods do return a plaintext, but they look better and are more useful as images\nimage_pods = {'VisualRepresentation',\n              'Illustration'}\n\n\n# do search-request\ndef request(query, params):\n    params['url'] = search_url.format(query=urlencode({'input': query}), api_key=api_key)\n    params['headers']['Referer'] = site_url.format(query=urlencode({'i': query}))\n\n    return params\n\n\n# replace private user area characters to make text legible\ndef replace_pua_chars(text):\n    pua_chars = {u'\\uf522': u'\\u2192',  # rigth arrow\n                 u'\\uf7b1': u'\\u2115',  # set of natural numbers\n                 u'\\uf7b4': u'\\u211a',  # set of rational numbers\n                 u'\\uf7b5': u'\\u211d',  # set of real numbers\n                 u'\\uf7bd': u'\\u2124',  # set of integer numbers\n                 u'\\uf74c': 'd',        # differential\n                 u'\\uf74d': u'\\u212f',  # euler's number\n                 u'\\uf74e': 'i',        # imaginary number\n                 u'\\uf7d9': '='}        # equals sign\n\n    for k, v in pua_chars.items():\n        text = text.replace(k, v)\n\n    return text\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    search_results = etree.XML(resp.content)\n\n    # return empty array if there are no results\n    if search_results.xpath(failure_xpath):\n        return []\n\n    try:\n        infobox_title = search_results.xpath(input_xpath)[0].text\n    except:\n        infobox_title = \"\"\n\n    pods = search_results.xpath(pods_xpath)\n    result_chunks = []\n    result_content = \"\"\n    for pod in pods:\n        pod_id = pod.xpath(pod_id_xpath)[0]\n        pod_title = pod.xpath(pod_title_xpath)[0]\n        pod_is_result = pod.xpath(pod_primary_xpath)\n\n        subpods = pod.xpath(subpods_xpath)\n        if not subpods:\n            continue\n\n        # Appends either a text or an image, depending on which one is more suitable\n        for subpod in subpods:\n            content = subpod.xpath(plaintext_xpath)[0].text\n            image = subpod.xpath(image_xpath)\n\n            if content and pod_id not in image_pods:\n\n                if pod_is_result or not result_content:\n                    if pod_id != \"Input\":\n                        result_content = \"%s: %s\" % (pod_title, content)\n\n                # if no input pod was found, title is first plaintext pod\n                if not infobox_title:\n                    infobox_title = content\n\n                content = replace_pua_chars(content)\n                result_chunks.append({'label': pod_title, 'value': content})\n\n            elif image:\n                result_chunks.append({'label': pod_title,\n                                      'image': {'src': image[0].xpath(img_src_xpath)[0],\n                                                'alt': image[0].xpath(img_alt_xpath)[0]}})\n\n    if not result_chunks:\n        return []\n\n    title = \"Wolfram|Alpha (%s)\" % infobox_title\n\n    # append infobox\n    results.append({'infobox': infobox_title,\n                    'attributes': result_chunks,\n                    'urls': [{'title': 'Wolfram|Alpha', 'url': resp.request.headers['Referer']}]})\n\n    # append link to site\n    results.append({'url': resp.request.headers['Referer'],\n                    'title': title,\n                    'content': result_content})\n\n    return results\n", "path": "searx/engines/wolframalpha_api.py"}]}