Created on 2015-04-08 11:44 by facundobatista, last changed 2015-04-23 03:19 by berker.peksag. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue23887.diff | berker.peksag, 2015-04-08 12:35 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg240262 - (view) | Author: Facundo Batista (facundobatista) * | Date: 2015-04-08 11:44 | |
I normally print(repr()) the exception I got, for debugging purposes. I use repr() because for builtin exceptions, str() will print only the message, and not the exception type. But for HTTPError, the repr() of it is "HTTPError()", without further explanation... |
|||
| msg240263 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2015-04-08 12:35 | |
HTTPError.__str__ already provides useful information: ``'HTTP Error %s: %s' % (self.code, self.msg)``, but since the change is minimal and useful, here is a patch. |
|||
| msg240269 - (view) | Author: Demian Brecht (demian.brecht) * | Date: 2015-04-08 15:01 | |
A test really should be added for this. Otherwise, LGTM. |
|||
| msg240462 - (view) | Author: Martin Panter (martin.panter) * | Date: 2015-04-11 05:36 | |
Perhaps it would be more appropriate to set the BaseException.args attribute, or chain to its __init__() method, then you wouldn’t need a custom __repr__(). |
|||
| msg241257 - (view) | Author: Facundo Batista (facundobatista) * | Date: 2015-04-16 18:33 | |
Hi Berker, I like your patch, will apply it after doing a test for it. |
|||
| msg241828 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-04-22 21:36 | |
New changeset e9ea679a92fa by Facundo Batista in branch 'default': Issue #23887: urllib.error.HTTPError now has a proper repr() representation. https://hg.python.org/cpython/rev/e9ea679a92fa |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2015-04-23 03:19:50 | berker.peksag | set | stage: patch review -> resolved |
| 2015-04-22 21:49:10 | facundobatista | set | status: open -> closed resolution: fixed |
| 2015-04-22 21:36:32 | python-dev | set | nosy:
+ python-dev messages: + msg241828 |
| 2015-04-16 18:33:14 | facundobatista | set | messages: + msg241257 |
| 2015-04-11 05:36:23 | martin.panter | set | nosy:
+ martin.panter messages: + msg240462 |
| 2015-04-08 15:01:29 | demian.brecht | set | nosy:
+ demian.brecht messages: + msg240269 |
| 2015-04-08 12:35:21 | berker.peksag | set | files:
+ issue23887.diff type: enhancement messages:
+ msg240263 |
| 2015-04-08 11:44:13 | facundobatista | create | |