Skip to content

Commit

Permalink
Chat: Prevent sys.setdefaultencoding()
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Aug 19, 2016
1 parent b3fa588 commit 13a3c81
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions chat/indico_chat/xmpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,24 @@

import posixpath
import re
import sys

import requests
from flask import current_app
from flask_pluginengine import current_plugin
from requests.exceptions import RequestException
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError

from indico.util.string import unicode_to_ascii
from indico_chat.util import check_config


# XXX: SleekXMPP sets the default encoding to UTF8. We don't want that!
sys.setdefaultencoding = lambda x: None
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError
del sys.setdefaultencoding


INVALID_JID_CHARS = re.compile(r'[^-!#()*+,.=^_a-z0-9]')
WHITESPACE = re.compile(r'\s+')

Expand Down

0 comments on commit 13a3c81

Please sign in to comment.