Not the prettiest method in the world. It's really "best effort" for some definition of "best."
Happens with strings that end in a dot.
Doesn't really matter, but this seems slightly more efficient and also cleaner.
New versions of gevent seem unhappy about this (raise exception with message "Impossible to call blocking function in the event loop callback" when handling an incoming HTTP request). I don't quite understand what that parameter is supposed to do and I think I don't it.