diff --git a/EDMarketConnector.py b/EDMarketConnector.py index c711f398..30dae527 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -260,7 +260,7 @@ class AppWindow: else: if __debug__: # Recording with open('%s%s.%s.json' % (data['lastSystem']['name'], data['commander'].get('docked') and '.'+data['lastStarport']['name'] or '', strftime('%Y-%m-%dT%H.%M.%S', localtime())), 'wt') as h: - h.write(json.dumps(data, indent=2, sort_keys=True)) + h.write(json.dumps(data, ensure_ascii=False, indent=2, sort_keys=True).encode('utf-8')) self.cmdr['text'] = data.get('commander') and data.get('commander').get('name') or '' self.system['text'] = data.get('lastSystem') and data.get('lastSystem').get('name') or '' diff --git a/eddn.py b/eddn.py index 5d174d59..5733b47e 100644 --- a/eddn.py +++ b/eddn.py @@ -12,6 +12,7 @@ from config import applongname, appversion, config import companion import outfitting +### upload = 'http://localhost:8081/upload/' # testing upload = 'http://eddn-gateway.elite-markets.net:8080/upload/' timeout= 10 # requests timeout @@ -31,7 +32,7 @@ def send(cmdr, msg): msg['header'] = { 'softwareName' : '%s [%s]' % (applongname, platform=='darwin' and "Mac OS" or system()), 'softwareVersion' : appversion, - 'uploaderID' : config.getint('anonymous') and hashlib.md5(cmdr.encode('utf-8')).hexdigest() or cmdr, + 'uploaderID' : config.getint('anonymous') and hashlib.md5(cmdr.encode('utf-8')).hexdigest() or cmdr.encode('utf-8'), } msg['message']['timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(config.getint('querytime') or int(time.time())))