BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364350 )

Change subject: striker: Set utf-8 for python runtime
......................................................................

striker: Set utf-8 for python runtime

Set PYTHONENCODING and LANG to sane values for a UTF-8 compliant
environment inside the Python interpreter. With a default C locale
Python3 picks the horrible ANSI_X3.4-1968 encoding for its stdout and
stderr streams. This in turn makes logging characters like É or 😂 crash
the whole request.

Arguably we could push these env settings all the way up to the systemd
unit/upstart scripts that start the parent uwsgi service, but doing so
means changing the environment for ORES as well and I don't want to
force this on them if they are not currently having problems.

Bug: T164034
Change-Id: I27798031654efe93a87b929b6b967ac16dc1589a
---
M modules/striker/manifests/uwsgi.pp
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/364350/1

diff --git a/modules/striker/manifests/uwsgi.pp 
b/modules/striker/manifests/uwsgi.pp
index 039d651..f344af7 100644
--- a/modules/striker/manifests/uwsgi.pp
+++ b/modules/striker/manifests/uwsgi.pp
@@ -55,6 +55,11 @@
             venv         => $venv_dir,
             wsgi         => 'striker.wsgi',
             vacuum       => true,
+            # T170189: make sure Python has a sane default encoding
+            env          => [
+                "LANG=C.UTF-8",
+                "PYTHONENCODING=utf-8",
+            ],
 
             logger       => [
                 "local file:${log_dir}/main.log",

-- 
To view, visit https://gerrit.wikimedia.org/r/364350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27798031654efe93a87b929b6b967ac16dc1589a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to