[Python-Dev] Re: [patch #100895 ] PyErr_Format

Greg Stein gstein@lyra.org
Thu, 20 Jul 2000 15:54:52 -0700

On Thu, Jul 20, 2000 at 10:04:15PM +0300, Moshe Zadka wrote:
> [M.-A. Lemburg]
> > You add your new PyErr_Format() replacement with the existing
> > subset of codes, but instead of bailing out when the function
> > sees a format code it doesn't understand, you use sprintf()
> > or snprintf() (where available) to format the unkown code ?!
> [Paul Prescod]
> > I think its too magical and could hide security holes under too many
> > levels of conditional behavior.
> FWIW, I agree with Paul -- if an unknown format code is used, it will be
> plainly seen in the exception, so we will know *exactly* what popular
> format codes we forgot to add.

Agreed. Just punt on unknown codes. The "failure mode" is obvious and the
fix is easy. We don't need complexity to resolve something which is obvious
and easy.


Greg Stein, http://www.lyra.org/