Exactly, which is why I had used en_US.UTF-8, but as you point out, it is quite easily broken. I have a working solution using the utmp module, which is available on all recent versions of Debian, Ubuntu, RedHat, and Fedora as python-utmp. What do you think?