Changes by Berker Peksag berker.pek...@gmail.com:
--
stage: patch review - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23887
___
___
Changes by Facundo Batista facu...@taniquetil.com.ar:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23887
___
Roundup Robot added the comment:
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
--
nosy: +python-dev
___
Facundo Batista added the comment:
Hi Berker, I like your patch, will apply it after doing a test for it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23887
___
Martin Panter added the comment:
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__().
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
New submission from Facundo Batista:
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
Berker Peksag added the comment:
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.
--
components: +Library (Lib)
keywords: +patch
nosy: +berker.peksag
stage: - patch
Demian Brecht added the comment:
A test really should be added for this. Otherwise, LGTM.
--
nosy: +demian.brecht
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23887
___