Context manager to temporarily set the locale to name.

An example is setting locale to “C” so that the C strtod() function will use “.” as the decimal point to enable consistent numerical string parsing.

Note that one cannot nest multiple set_locale() context manager statements as this causes a threading lock.

This code taken from

name : str

Locale name, e.g. “C” or “fr_FR”.