summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--databaseReset.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/databaseReset.py b/databaseReset.py
index c2a0d9b..1d8427b 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -4,6 +4,7 @@ import time
import timeit
import json
import resource
+import locale
import settings
""" Command-line utility for loading cave data files into troggle's database.
@@ -353,6 +354,16 @@ if __name__ == "__main__":
print("Do not run as root or using sudo - file permissions for cache files and logs will break")
print("Aborting run.")
exit()
+
+ if sys.getfilesystemencoding() != "utf-8":
+ print("UTF-8 is NOT the default file encoding. You must fix this.")
+ print(f'- {sys.getdefaultencoding()=}')
+ print(f'- {sys.getfilesystemencoding()=}')
+ print(f'- {locale.getdefaultlocale()=}')
+ print(f'- {locale.getpreferredencoding()=}')
+ print("Aborting run.")
+ exit()
+
if len(sys.argv)>2:
runlabel = sys.argv[len(sys.argv)-1]
else: