Skip to content

TypeError Handling#61

Merged
brentru merged 2 commits into
masterfrom
fix-typerror
Jul 17, 2018
Merged

TypeError Handling#61
brentru merged 2 commits into
masterfrom
fix-typerror

Conversation

@brentru
Copy link
Copy Markdown
Member

@brentru brentru commented Jul 16, 2018

Issue:
When a feed is called which doesn't exist, a 404 is not returned. Instead the following is returned:

TypeError: the JSON object must be str, not 'bytes'

Platforms Effected by Issue:
Python Ver <3.6

Patch Notes:

  • Python3.6.x can handle str, bytes, bytearray with builtin JSON but Python3.5.x (which ships with Debian Stretch) can't. We switched response handling to str instead of bytes using the requests library in errors.py.
  • Edited simple.py to reflect API-V2 and feed check/generation.

Issue referenced:
#58
#57
https://forums.adafruit.com/viewtopic.php?f=56&t=138210

@brentru brentru added the bug label Jul 16, 2018
@jerryneedell
Copy link
Copy Markdown

I tried this (from the fix_typerror branch) on my Raspberry Pi and it worked under both python3.5.3 and python3.6.5. In both cases, I ran it with the "test" feed non-existent and it created it successfully.

@brentru brentru merged commit 80b455a into master Jul 17, 2018
@brentru brentru deleted the fix-typerror branch July 17, 2018 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants