tienfuc / gdcmdtools

Google drive command-line tools
BSD 2-Clause "Simplified" License
57 stars 4 forks source link

TypeError: int() argument must be a string or a number, not 'NoneType' error on gdget #60

Closed tshrinivasan closed 9 years ago

tshrinivasan commented 9 years ago

I get the following error when using gdget to download a file.

gdget.py --export_format txt Traceback (most recent call last): File "/usr/local/bin/gdget.py", line 65, in result = get.run() File "/usr/local/lib/python2.7/dist-packages/gdcmdtools/get.py", line 109, in run result, local_size = self.get_by_format(self.save_as, return_format[self.format]) File "/usr/local/lib/python2.7/dist-packages/gdcmdtools/get.py", line 163, in get_by_format total_length = int(self.file_size) TypeError: int() argument must be a string or a number, not 'NoneType'

tshrinivasan commented 9 years ago

The reason behind this seems the fileSize attribute is not retrieved from the response object.

File; get.py line : 89 self.file_size = service_response.get('fileSize', None)

There is no fileSize attribute or size related attributes in the service_response.

Exploring more on how to fix this.

tienfuc commented 9 years ago

tshrinivasan, Thanks for your report, the commit should fix this issue.

tshrinivasan commented 9 years ago

Awesome.

It works perfectly.

Thanks for the quick fix.