using 'message' in a BzrError format string results in unprintable exceptions
Bug #110143 reported by
Robert Collins
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
High
|
Unassigned |
Bug Description
BzrError formats the _fmt using self.__dict__.
However, self.message does not appear in self.__dict__ because its
handled by a data descriptor in BaseException.
We might be able to fix this with some python innards voodoo, but for
now, just documenting that its bad and correcting our usage of 'message'
in the format strings is sufficient.
BzrCheckError, WeaveError, are broken.
e.g.
>>> str(errors.
"Unprintable exception BzrCheckError: dict={'
None}, fmt='Internal check failed: %(message)s',
error=KeyError(
affects /products/bzr
status confirmed
importance high
-Rob
--
GPG key available at: <http://
To post a comment you must log in.
Robert Collins пишет: BzrCheckError( 'foo')) _preformatted_ string' : 'message' ,)"
> Public bug reported:
>
> BzrError formats the _fmt using self.__dict__.
>
> However, self.message does not appear in self.__dict__ because its
> handled by a data descriptor in BaseException.
>
> We might be able to fix this with some python innards voodoo, but for
> now, just documenting that its bad and correcting our usage of 'message'
> in the format strings is sufficient.
>
> BzrCheckError, WeaveError, are broken.
>
> e.g.
>>>> str(errors.
> "Unprintable exception BzrCheckError: dict={'
> None}, fmt='Internal check failed: %(message)s',
> error=KeyError(
>
> affects /products/bzr
> status confirmed
> importance high
This issue exist in Python 2.5, because in 2.5 exceptions now new-style classes,
and 'messages' listed in __slots__. For LockError I recently changed 'message' to 'msg'.
I think we need to change and other places too.