diff options
author | emkael <emkael@tlen.pl> | 2017-12-28 00:59:29 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-12-28 00:59:29 +0100 |
commit | 5fcd17c81a01af31a68a317a9443e55856c470a2 (patch) | |
tree | 2c0382707a9efd0f86dca2f3a8ef253f2d17915c /src | |
parent | c58133066ffe7cef126584b84da124634d7f0e99 (diff) |
Encoding issues with socket error messages
Diffstat (limited to 'src')
-rw-r--r-- | src/bidding_data.py | 2 | ||||
-rw-r--r-- | src/bidding_data_gui.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/bidding_data.py b/src/bidding_data.py index bd395d8..b4f2fe7 100644 --- a/src/bidding_data.py +++ b/src/bidding_data.py @@ -701,7 +701,7 @@ class JFRBidding(object): 'sent file to Goniec: %s', file_sent) except socket.error as err: log.getLogger('goniec').error( - 'unable to connect to Goniec: %s', err) + 'unable to connect to Goniec: %d', err.errno) else: log.getLogger('goniec').info('nothing to send') diff --git a/src/bidding_data_gui.py b/src/bidding_data_gui.py index c41504e..c07ff8f 100644 --- a/src/bidding_data_gui.py +++ b/src/bidding_data_gui.py @@ -543,8 +543,10 @@ class BiddingGUI(tk.Frame): self.__messages_mutex.acquire() self.__messages_to_output = copy.copy(self.__messages) self.__messages = [] + for m in self.__messages_to_output: + print m if len(self.__messages_to_output) > 0: - msg = '\n'.join(self.__messages_to_output).encode('utf8') + msg = '\n'.join(self.__messages_to_output) # Append message to the Text widget, at the end.""" self.text.master.queue(self.text.insert, tk.END, msg + '\n') # scroll to the bottom, afterwards @@ -586,14 +588,14 @@ class BiddingGUI(tk.Frame): self.__messages.append( ('Podczas wykonywania programu wystąpiły błędy ' + 'w liczbie: %d\n' + - 'Sprawdź dziennik logów\n').decode('utf8') + 'Sprawdź dziennik logów\n').decode('utf-8') % self.errors()) self.text.master.queue(res.play, 'error') elif self.warnings(): self.__messages.append( ('Podczas wykonywania programu wystąpiły ' + 'ostrzeżenia w liczbie: %d\n' + - 'Sprawdź dziennik logów\n').decode('utf8') + 'Sprawdź dziennik logów\n').decode('utf-8') % self.warnings()) self.text.master.queue(res.play, 'warning') else: |