> I would do os.environ.get("LANG", "some default") to be extra paranoid.

Makes sense

> Why do you split() it on the '.' character? That will return an array, did you want to get the first component of that?

No, but you're right — there's no need to do a split. I was a bit confused by example in documentation, where setlocale is called with a tuple ("en_us", "UTF-8") as a second argument, but a string is okay too.

Fixing that in next commit.