The current production server has Python 3.11.
The change is directly motivated by a CI error (AttributeError: module
'locale' has no attribute 'getencoding') in code introduced in
f3c82f4. According to Python docs, the locale.getencoding() function
was introduced in 3.11.