AIRAVATA-3697 log error if filesystemencoding isn't 'utf-8'
diff --git a/django_airavata/apps/api/exceptions.py b/django_airavata/apps/api/exceptions.py
index 557e760..7d26a57 100644
--- a/django_airavata/apps/api/exceptions.py
+++ b/django_airavata/apps/api/exceptions.py
@@ -1,4 +1,5 @@
import logging
+import sys
from airavata.api.error.ttypes import (
AuthorizationException,
@@ -58,6 +59,11 @@
if response is not None:
response.data['is_authenticated'] = False
+ if isinstance(exc, UnicodeEncodeError):
+ fse = sys.getfilesystemencoding()
+ if fse != 'utf-8':
+ log.error(f"filesystem encoding is {fse}, not 'utf-8'. File paths with Unicode characters will produce errors.")
+
# Generic handler
if response is None:
log.error("API exception", exc_info=exc, extra={'request': context['request']})