Create a new default callbacks dict for each parser

Merged
KL
1mo ago
+20-6

MultipartParser, QuerystringParser and OctetStreamParser used {} as the default for callbacks and kept that object, so all parsers of a class created without the argument shared one dict. Calling set_callback() on one of them changed the others too, including parsers created later.

Each parser now creates its own dict when callbacks isn't passed. A dict you pass is still used as is.

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.