oonid / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Fix for AttributeError in errors.py __repr__ #240

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make an api call that results in an error status and reason set to None.
2. Call __repr__ on the raised HttpError.
3. Observe an AttributeError.

What is the expected output? What do you see instead?
__repr__ should always return a string and safely handle unexpected values.

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

This is the last couple of lines of the stack trace that shows up:

File 
"/cozi/apps/cozi-googlemsghandler/google_api_python_client-1.0-py2.7.egg/apiclie
nt/errors.py", line 57, in __repr__
    self.resp.status, self.uri, self._get_reason().strip())
AttributeError: 'NoneType' object has no attribute 'strip'

Original issue reported on code.google.com by thomas.v...@gmail.com on 21 Feb 2013 at 12:00

GoogleCodeExporter commented 8 years ago
I added a fix on my clone. Please let me know if that is not sufficient to 
submit a patch. Thanks!

https://code.google.com/r/thomasvandoren-google-api-python-client/source/detail?
r=c34e675a4dcab6b62352136cbedb8e2a9427d70c

Original comment by thomas.v...@gmail.com on 21 Feb 2013 at 12:01

GoogleCodeExporter commented 8 years ago
Looks like this was already fixed. Sorry for the dupe.

Original comment by thomas.v...@gmail.com on 21 Feb 2013 at 12:03

GoogleCodeExporter commented 8 years ago

Original comment by dhermes@google.com on 21 Feb 2013 at 2:26