Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311614

Change subject: labspuppetbackend: Set charset explicitly
......................................................................

labspuppetbackend: Set charset explicitly

Also make sure empty checks check for both str and byte

Change-Id: Icad5a92bbd5282e0726ffd3071c98d627cf35346
---
M modules/labspuppetbackend/files/labspuppetbackend.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/14/311614/1

diff --git a/modules/labspuppetbackend/files/labspuppetbackend.py 
b/modules/labspuppetbackend/files/labspuppetbackend.py
index c5e43b2..e159f4d 100644
--- a/modules/labspuppetbackend/files/labspuppetbackend.py
+++ b/modules/labspuppetbackend/files/labspuppetbackend.py
@@ -28,7 +28,8 @@
         host=os.environ['MYSQL_HOST'],
         db=os.environ['MYSQL_DB'],
         user=os.environ['MYSQL_USERNAME'],
-        passwd=os.environ['MYSQL_PASSWORD']
+        passwd=os.environ['MYSQL_PASSWORD'],
+        charset='utf8'
     )
 
 
@@ -250,7 +251,10 @@
         """, (project, ))
         # Do the inverse of _preprocess_prefix, so callers get a consistent 
view
         return Response(
-            yaml.safe_dump({'prefixes': ['_' if r[0] == b'' else r[0] for r in 
cur.fetchall()]}),
+            yaml.safe_dump({
+                'prefixes':
+                ['_' if r[0] == b'' or r[0] == ''
+                 else r[0] for r in cur.fetchall()]}),
             status=200,
             mimetype='application/x-yaml'
         )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icad5a92bbd5282e0726ffd3071c98d627cf35346
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <yuvipa...@wikimedia.org>

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

Reply via email to