[New-bugs-announce] [issue34998] Logging formatter validation breaks backward ducktyping

P.C. Kroon report at bugs.python.org
Tue Oct 16 10:56:59 EDT 2018


New submission from P.C. Kroon <p.c.kroon at rug.nl>:

Hi all!

This concerns commit 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 (also known as bpo-34844 or GH-9703).

For testing purposes I made something that transparently ducktypes being a string, except that it counts how often its `format` and `__mod__` methods are called. The validation mechanic now tries to pass my object to `self.validation_pattern.search` (line 441), which (of course) doesn't work. Due to backwards compatability I can't pass a validate keyword.
To resolve this, I'd like the default `validate` option to be set to `False` instead of `True`.

If the judgement is that I'm doing really weird things and should make an actual string subclass I'll also accept that and/or find an alternative solution.

Cheers, Peter

----------
messages: 327837
nosy: P.C. Kroon
priority: normal
severity: normal
status: open
title: Logging formatter validation breaks backward ducktyping
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34998>
_______________________________________


More information about the New-bugs-announce mailing list