python-mega icon indicating copy to clipboard operation
python-mega copied to clipboard

Can't upload a file - req.json()[0], int onbject has no attribute __getitem__

Open Ajip44 opened this issue 8 years ago • 2 comments

Great job on the wrapper, unfortunatelly I cannot upload a file:

image

Ajip44 avatar May 28 '17 13:05 Ajip44

/Users/charlesrenan/anaconda3/envs/ipykernel_py2/lib/python2.7/site-packages/mega/mega.py in api_req(self, data)
     42         req = requests.post('https://g.api.mega.co.nz/cs', params=params, data=data)
     43         # TODO: error handling
---> 44         return req.json()[0]
     45 
     46     def login_user(self, email, password):

TypeError: 'int' object has no attribute '__getitem__'

madchucky avatar Nov 22 '17 15:11 madchucky

@juanriaza How would you do that error handling?

madchucky avatar Nov 22 '17 15:11 madchucky