Skip to content

Commit b0775f3

Browse files
committed
make-sqlite.py locale fix
This would fix EFForg#653. My Python is hella basic though, so this might be horribly wrong. Open to criticism and/or suggestions. @jsha It works locally, but that doesn't necessarily mean I've done it right, heh.
1 parent cd16b6a commit b0775f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/make-sqlite.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
# This is important for deterministic builds.
1717
# https://trac.torproject.org/projects/tor/ticket/11630#comment:20
1818
# It's also helpful to ensure consistency for the lowercase check below.
19-
locale.setlocale(locale.LC_ALL, 'en_US.UTF8')
19+
# Systems differ on UTF8 or UTF-8. Use try to test both to avoid failures.
20+
try :
21+
locale.setlocale(locale.LC_ALL, 'en_US.UTF8')
22+
except :
23+
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
24+
else :
25+
raise
2026

2127
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), '../src/defaults/rulesets.sqlite'))
2228
c = conn.cursor()

0 commit comments

Comments
 (0)