Antoine Pitrou added the comment: I'm wary of raising an exception. Assuming Benjamin's patch is correct, I vote for it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31530> _______________________________________