Skip to content

Commit

Permalink
core/server.py: Fixed a Unicode-related exception bug in broadcast_me…
Browse files Browse the repository at this point in the history
…ssage() with Python 2.
  • Loading branch information
liftoff committed Aug 31, 2014
1 parent efcd5b7 commit 8dab167
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gateone/__init__.py
Expand Up @@ -3,7 +3,7 @@
__version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>'
__commit__ = "20140830220553" # Gets replaced by git (holds the date/time)
__commit__ = "20140830222151" # Gets replaced by git (holds the date/time)

import os
GATEONE_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
4 changes: 3 additions & 1 deletion gateone/core/server.py
Expand Up @@ -15,7 +15,7 @@
"version": __version__
}
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>'
__commit__ = "20140830220553" # Gets replaced by git (holds the date/time)
__commit__ = "20140830222151" # Gets replaced by git (holds the date/time)

# NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\
Expand Down Expand Up @@ -939,6 +939,8 @@ def broadcast_message(args=sys.argv, message=""):
with io.open(broadcast_file, 'w') as b:
if not message:
for message in args:
if isinstance(message, bytes):
message = message.decode('utf-8')
logging.info(_("Broadcasting %s to all users") % repr(message))
b.write(message)

Expand Down
2 changes: 1 addition & 1 deletion gateone/static/gateone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8dab167

Please sign in to comment.