From 72f3381ef38eda48fdf4361ea127e34cf3253490 Mon Sep 17 00:00:00 2001 From: Roger Aiudi Date: Fri, 26 Jun 2020 21:45:49 -0400 Subject: [PATCH] Handle missing locale.LC_MESSAGES enum on Windows --- gssapi/raw/misc.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gssapi/raw/misc.pyx b/gssapi/raw/misc.pyx index ca1be8ca..622bfb7e 100644 --- a/gssapi/raw/misc.pyx +++ b/gssapi/raw/misc.pyx @@ -291,7 +291,10 @@ class GSSError(Exception, metaclass=GSSErrorRegistry): given code """ - msg_encoding = locale.getlocale(locale.LC_MESSAGES)[1] or 'UTF-8' + try: + msg_encoding = locale.getlocale(locale.LC_MESSAGES)[1] or 'UTF-8' + except AttributeError: # Windows doesn't have LC_MESSAGES + msg_encoding = 'UTF-8' res = [] try: