pallets/markupsafe

Missing override to `format_map`

xmo-odoo opened this issue · 3 comments

str.format_map was added in 3.2, but it's not overridden by markupsafe, so if a user format_maps into a Markup expecting the same behaviour as format or __mod__ they'll be disappointed:

>>> Markup('{a}').format(a='<>')
Markup('&lt;&gt;')
>>> Markup('{a}').format_map({'a': '<>'})
'<>'

I've noticed some other str methods that return str and should be wrapped as well: casefold, removeprefix, and removesuffix.

MarkupSafe 2.1.3 is now available on PyPI.

👍 thank you very much