Issue 3302: segfault on gettext(None) (original) (raw)

msgid of gettext(), dgettext(), dcgettext() C functions can not be NULL (domainname can be NULL): "import locale; locale.gettext(None)" generates a segfault.

domainname argument of bindtextdomain() have to be a non empty string: "locale.bindtextdomain(NULL, NULL)" or locale.bindtextdomain('', NULL)" generates an OSError(0).

Attached patch fixes the two bugs.