lionheart / python-harvest

A Python wrapper for the Harvest time-tracking API.
Apache License 2.0
55 stars 49 forks source link

harvest.harvest.HarvestError: No JSON object could be decoded #4

Closed ghost closed 9 years ago

ghost commented 9 years ago

I get this error:

harvest.harvest.HarvestError: No JSON object could be decoded

on a successful delete request. I am not asking for a decodable JSON object, necessarily, but the code is attempting to return one.

My current 'solution' is to throw this in a try: except block and put the confirmation in the except block, but that's obviously suboptimal.

What's going on here, and what can I do to utilize this functionality correctly?

ghost commented 9 years ago

It should, as nothing relevant would have been changed. EDIT: Somehow, I'm not, though. I'll reopen this if I can reproduce it.

On Wed Feb 11 2015 at 2:04:57 PM Alex Goretoy notifications@github.com wrote:

Is this still affecting you after version update?

— Reply to this email directly or view it on GitHub https://github.com/lionheart/python-harvest/issues/4#issuecomment-73942354 .

ghost commented 9 years ago

Ah, yes, here we are again. I was using the delete method, on an existing entry, it did delete, then threw this error. Thanks~

Traceback (most recent call last): File "/usr/local/bin/sow", line 9, in load_entry_point('Sow==0.1', 'console_scripts', 'sow')() File "build/bdist.macosx-10.10-x86_64/egg/sow/console.py", line 39, in main File "build/bdist.macosx-10.10-x86_64/egg/sow/console.py", line 33, in _main File "build/bdist.macosx-10.10-x86_64/egg/sow/commands.py", line 154, in delete

File "/usr/local/lib/python2.7/site-packages/harvest/harvest.py", line 148, in delete return self._delete('/daily/delete/{0}'.format(entry_id)) File "/usr/local/lib/python2.7/site-packages/harvest/harvest.py", line 160, in _delete return self._request('DELETE', path, data) File "/usr/local/lib/python2.7/site-packages/harvest/harvest.py", line 174, in _request raise HarvestError(e) harvest.harvest.HarvestError: No JSON object could be decoded

ghost commented 9 years ago

Ah sorry, I had upgraded in a venv. It's now working the way I would expect it to. Thanks for your help!