Ottomata has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/391019 )
Change subject: Parse userAgent if it is a string type ...................................................................... Parse userAgent if it is a string type This failed in production (but not beta?) because the %{userAgent}i parsed string was a unicode string. Bug: T179625 Change-Id: Ic4d642790085945e0a93907f947cc660b3ef479e --- M eventlogging/parse.py 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Ottomata: Looks good to me, approved jenkins-bot: Verified diff --git a/eventlogging/parse.py b/eventlogging/parse.py index ebf7093..8b21594 100644 --- a/eventlogging/parse.py +++ b/eventlogging/parse.py @@ -44,7 +44,7 @@ import time import uuid -from .compat import json, unquote_plus, uuid5 +from .compat import json, unquote_plus, uuid5, string_types from .event import Event from .utils import parse_ua, iso8601_from_timestamp @@ -190,7 +190,9 @@ # TODO: remove this code in favor of %u format specifier # after %{userAgent}i is not used. T179625 - if 'userAgent' in event and isinstance(event['userAgent'], str): + if 'userAgent' in event and isinstance( + event['userAgent'], string_types + ): event['userAgent'] = json.dumps(parse_ua(event['userAgent'])) return Event(event) -- To view, visit https://gerrit.wikimedia.org/r/391019 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4d642790085945e0a93907f947cc660b3ef479e Gerrit-PatchSet: 4 Gerrit-Project: eventlogging Gerrit-Branch: master Gerrit-Owner: Ottomata <ao...@wikimedia.org> Gerrit-Reviewer: Ottomata <ao...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits