From cbf209c6b5f65eff1580623097550b162952701b Mon Sep 17 00:00:00 2001 From: "A. Svensson" Date: Fri, 3 Apr 2015 12:39:01 +0200 Subject: [PATCH] Fixed stupid unicode issue. --- src/gameservers/management/commands/update_server_stats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gameservers/management/commands/update_server_stats.py b/src/gameservers/management/commands/update_server_stats.py index 038bf65..e84cbbe 100755 --- a/src/gameservers/management/commands/update_server_stats.py +++ b/src/gameservers/management/commands/update_server_stats.py @@ -51,19 +51,19 @@ class ServerParser(object): def _parse_server_data(self, data): '''Parse the individual parts of each server.''' try: - title = data.find('b').get_text().splitlines()[0].strip() + title = data.find('b').get_text().splitlines()[0].strip().encode('utf-8') except AttributeError: # HACK: I think this happends because the raw data was incomplete. # No complete data, no server update. return None - game_url = data.find('span', 'smaller').text + game_url = data.find('span', 'smaller').text.encode('utf-8') tmp = data.find('a') site_url = None # Default means the server hasn't set a custom site url if tmp and not tmp.text == 'Default': try: - site_url = tmp['href'] + site_url = tmp['href'].encode('utf-8') # Handle some funky servers... if site_url == 'http://': site_url = ''