Skip to content

Need better error handling when internet connection is down. #28

Open
@vivekhub

Description

@vivekhub

When we run the tests on a VM with no network access, we get a strange TypeError. Seems to be inside urllib project.

Traceback (most recent call last):
File "tests/test_simplenote.py", line 19, in setUp
self.clear_all_notes()
File "tests/test_simplenote.py", line 209, in clear_all_notes
res, status = self.simplenote_instance.get_note_list()
File "/Users/vivekv/.venv/simplenote/lib/python3.7/site-packages/simplenote/simplenote.py", line 273, in get_note_list
response = urllib2.urlopen(request)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1362, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1319, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1293, in _send_request
self.putheader(hdr, value)
File "/usr/local/Cellar/python/3.7.6/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1229, in putheader
if _is_illegal_header_value(values[i]):
TypeError: expected string or bytes-like object

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenhancementup for grabsMaintainer has no plans to work themselves. Feel free to tackle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions