Imgur/imgurpython

JSON decoding of response failed after trying client.upload_from_path()

aldilaff opened this issue · 4 comments

I am trying to upload this gif back to imgur using

try:
        print("Uploading image... ")
        imageURL = client.upload_from_path('hlN3NZZ.gif', config=None, anon=False)
    except ImgurClientError as e:
        print(e.error_message)
        print(e.status_code)

However I keep getting:

JSON decoding of response failed.
None

Could it be due to the large size of the gif?

No, it's because commit cb717fe by @khazhyk forgot to add a return, so the function always returns None :(

I got the same issue when I was using client.upload_from_path() function.

any update for this issue ?

........ib/python2.7/site-packages/imgurpython/client.py", line 158, in make_request raise ImgurClientError('JSON decoding of response failed.')ImgurClientError: JSON decoding of response failed.

@charlieworld, use 1.1.7, which is the version on PyPI.

@salty-horse thanks a lot !

I fount out the problem I got is that the photo I upload was too large...... (24mb)

When I using the small image file to test it, it work !

I think I need to write another code to check the file before upload.......