You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vision raises TypeError: b'...' is not JSON serializable on Python 3 #2525
Traceback (most recent call last):
File "quickstart.py", line 51, in <module>
run_quickstart()
File "quickstart.py", line 38, in run_quickstart
image = vision_client.image(
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/site-packages/google/cloud/vision/image.py", line 139, in detect_labels
return self._detect_annotation(feature)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/site-packages/google/cloud/vision/image.py", line 105, in _detect_annotation
result = self.client.annotate(self, [feature])
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/site-packages/google/cloud/vision/client.py", line 106, in annotate
data=data)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/site-packages/google/cloud/connection.py", line 341, in api_request
data = json.dumps(data)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/json/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/json/encoder.py", line 192, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/json/encoder.py", line 250, in iterencode
return _iterencode(o, 0)
File "/Users/jonwayne/.pyenv/versions/3.4.3/lib/python3.4/json/encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
Activity
theacodes commentedon Oct 11, 2016
Stack trace:
dhermes commentedon Oct 11, 2016
Same issue fixed by #2520?
theacodes commentedon Oct 11, 2016
Seems like it, vision probably just needs a similar patch.
dhermes commentedon Oct 11, 2016
Oh my blindness!
@daspecster Do the system tests for vision not cover this?
daspecster commentedon Oct 11, 2016
Zoinks! That bytes. I will get on this right now.
theacodes commentedon Oct 11, 2016
heheh.
daspecster commentedon Oct 11, 2016
@dhermes Also, sadly there are no system tests for this.
I made an issue to add system tests though.
#2526
dhermes commentedon Oct 11, 2016
Ah. That is no good. We should not have pushed to PyPI without system tests. Live and learn.
daspecster commentedon Oct 11, 2016
Agreed. I don't think we even brought it up anywhere.
@dhermes I don't think I have access to the system test project(
precise-truck?) to add things like images and audio to run the tests on.dhermes commentedon Oct 11, 2016
@daspecster Get them working locally first and then we can cross that bridge?
daspecster commentedon Oct 11, 2016
Ok, will do.
Properly encode image content. Fixes googleapis#2525.
Properly encode image content. Fixes googleapis#2525.
daspecster commentedon Oct 12, 2016
@jonparrott just merged the fix for this. Let me know if you run into any more issues! Thanks!
theacodes commentedon Oct 12, 2016
Thanks, will await the next release before I can test it.
On Wed, Oct 12, 2016, 7:45 AM Thomas Schultz notifications@github.com
wrote:
talzion12 commentedon Nov 9, 2016
I'm waiting for the fix for this issue to be released. @jonparrott Do you know when the next release will be?
theacodes commentedon Nov 15, 2016
It's been released, @meta221
Properly encode image content. Fixes googleapis#2525.
Properly encode image content. Fixes #2525.
build(deps): bump pyasn1 from 0.6.1 to 0.6.2 (#2525)
refactor: Improve cache encapsulation (#2525)