bpo-26133: Fix typos (#5010)

* Fix typos
* Change warning text
* Add test
2 files changed