kura / yarg

A semi hard Cornish cheese, also queries PyPI
https://yarg.readthedocs.org
MIT License
20 stars 6 forks source link

`yarg.get()` error on python3 #3

Closed schettino72 closed 10 years ago

schettino72 commented 10 years ago
(py34)~/work/third_party/yarg$ python
Python 3.4.0b2+ (default:d0e2437136f5, Jan 20 2014, 10:53:19) 
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yarg
>>> doit = yarg.get('doit')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eduardo/work/third_party/yarg/yarg/client.py", line 51, in get
    return json2package(response.content)
  File "/home/eduardo/work/third_party/yarg/yarg/package.py", line 322, in json2package
    return Package(json.loads(json_content))
  File "/usr/local/lib/python3.4/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
kura commented 10 years ago

Ok, now this one is interesting. While travis and tox both say tests on Python 3 are working as expected, this is a bug between requests, yarg and the stdlib json module.

kura commented 10 years ago

I've fixed the bug itself and confirm it works as expected, the issue now it's that the tests are failing due to the differences between python2 and 3.