Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vivekhub opened this issue Apr 23, 2020 · 1 comment
Open

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

vivekhub opened this issue Apr 23, 2020 · 1 comment
Labels
bug enhancement up for grabs Maintainer has no plans to work themselves. Feel free to tackle.

Comments

@vivekhub
Copy link

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

@atomicules
Copy link
Collaborator

atomicules commented Apr 24, 2020

Looks very closely related to: #27

For the same reasons given there this is not something I can work on myself (if I don't have a network connection I don't tend to have access to my main development machine 😉 )

However, I welcome contributions - perhaps in addition to or based off of that PR. It needs to be well proven enough that I can merge without testing myself.

@atomicules atomicules added bug enhancement up for grabs Maintainer has no plans to work themselves. Feel free to tackle. labels Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement up for grabs Maintainer has no plans to work themselves. Feel free to tackle.
Projects
None yet
Development

No branches or pull requests

2 participants