gawel / WSGIProxy2

A WSGI Proxy with various http client backends

Home Page:https://wsgiproxy2.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failures in test from wsgiproxy2-0.4.2 under py3

idella opened this issue · comments

In testsuite of wsgiproxy2-0.4.2 under py3. there are errorsX3;

test_quoted_utf8_url, test_quoted_utf8_url & test_quoted_utf8_url.

======================================================================
ERROR: test_quoted_utf8_url (wsgiproxy.tests.TestHttplib)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/wsgiproxy2-0.4.2/work/WSGIProxy2-0.4.2/wsgiproxy/tests.py", line 103, in test_quoted_utf8_url
    resp = self.app.get(path)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 286, in get
    expect_errors=expect_errors)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 595, in do_request
    self._check_status(status, res)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 624, in _check_status
    res)
webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://127.0.0.1:50200/targets/NR2F1%C3%82-human/)
b'Internal Server Error\r\n\r\nTraceback (most recent call last):\n  File "/usr/lib64/python3.4/site-packages/waitress/channel.py", line 337, in service\n    task.service()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 173, in service\n    self.execute()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 392, in execute\n    app_iter = self.channel.server.application(env, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/http.py", line 83, in wrapper\n    return self.test_app(environ, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/debugapp.py", line 49, in __call__\n    body = body.encode(\'ascii\')\nUnicodeEncodeError: \'ascii\' codec can\'t encode characters in position 151-152: ordinal not in range(128)\n\r\n\r\n(generated by waitress)'

======================================================================
ERROR: test_quoted_utf8_url (wsgiproxy.tests.TestRequests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/wsgiproxy2-0.4.2/work/WSGIProxy2-0.4.2/wsgiproxy/tests.py", line 103, in test_quoted_utf8_url
    resp = self.app.get(path)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 286, in get
    expect_errors=expect_errors)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 595, in do_request
    self._check_status(status, res)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 624, in _check_status
    res)
nose.proxy.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://127.0.0.1:54658/targets/NR2F1%C3%82-human/)
b'Internal Server Error\r\n\r\nTraceback (most recent call last):\n  File "/usr/lib64/python3.4/site-packages/waitress/channel.py", line 337, in service\n    task.service()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 173, in service\n    self.execute()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 392, in execute\n    app_iter = self.channel.server.application(env, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/http.py", line 83, in wrapper\n    return self.test_app(environ, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/debugapp.py", line 49, in __call__\n    body = body.encode(\'ascii\')\nUnicodeEncodeError: \'ascii\' codec can\'t encode characters in position 276-277: ordinal not in range(128)\n\r\n\r\n(generated by waitress)'
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 127.0.0.1
requests.packages.urllib3.connectionpool: DEBUG: "GET /targets/NR2F1%C3%82-human/ HTTP/1.1" 500 799
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_quoted_utf8_url (wsgiproxy.tests.TestUrllib3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/wsgiproxy2-0.4.2/work/WSGIProxy2-0.4.2/wsgiproxy/tests.py", line 103, in test_quoted_utf8_url
    resp = self.app.get(path)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 286, in get
    expect_errors=expect_errors)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 595, in do_request
    self._check_status(status, res)
  File "/usr/lib64/python3.4/site-packages/webtest/app.py", line 624, in _check_status
    res)
nose.proxy.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://127.0.0.1:50848/targets/NR2F1%C3%82-human/)
b'Internal Server Error\r\n\r\nTraceback (most recent call last):\n  File "/usr/lib64/python3.4/site-packages/waitress/channel.py", line 337, in service\n    task.service()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 173, in service\n    self.execute()\n  File "/usr/lib64/python3.4/site-packages/waitress/task.py", line 392, in execute\n    app_iter = self.channel.server.application(env, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/http.py", line 83, in wrapper\n    return self.test_app(environ, start_response)\n  File "/usr/lib64/python3.4/site-packages/webtest/debugapp.py", line 49, in __call__\n    body = body.encode(\'ascii\')\nUnicodeEncodeError: \'ascii\' codec can\'t encode characters in position 169-170: ordinal not in range(128)\n\r\n\r\n(generated by waitress)'
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: INFO: Starting new HTTP connection (1): 127.0.0.1
urllib3.connectionpool: DEBUG: "GET /targets/NR2F1%C3%82-human/ HTTP/1.1" 500 799
--------------------- >> end captured logging << ---------------------

Name                        Stmts   Miss  Cover   Missing
---------------------------------------------------------
wsgiproxy                       3      0   100%   
wsgiproxy.proxies             161      0   100%   
wsgiproxy.requests_client      28      2    93%   26, 32
wsgiproxy.urllib3_client       21      0   100%   
---------------------------------------------------------
TOTAL                         213      2    99%   
----------------------------------------------------------------------
Ran 31 tests in 3.388s

FAILED (errors=3)

They are all UnicodeEncode type Errors re utf under py3. They all source immediately to
the system installed /waitress/channel.py", line 337. It's looking like code inadequately converted or ported to python3. I haven't had another user replicate yet. Can you replicate?

Everything is fine here. I think you need the latest webtest release. You can try using tox

no need for tox. It passes with ONLY the latest webtest, these 3 errors occur with both webtest 2.0.15 & 2.0.16. The version therefore requires setting in the source somewhere. It is commonly done by use of var test_requires= in setup.py