From 1f94ed66edb7e0bcc4f5ec3b7d4cf064f901ce07 Mon Sep 17 00:00:00 2001 From: Johannes Pohl Date: Wed, 29 Nov 2017 14:59:05 +0100 Subject: [PATCH] fix linebreaks in protocol sniff file --- src/urh/signalprocessing/ProtocolSniffer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/urh/signalprocessing/ProtocolSniffer.py b/src/urh/signalprocessing/ProtocolSniffer.py index 249dfbbf81..6775cd5b91 100644 --- a/src/urh/signalprocessing/ProtocolSniffer.py +++ b/src/urh/signalprocessing/ProtocolSniffer.py @@ -96,8 +96,10 @@ def on_rcv_thread_index_changed(self, old_index, new_index): self.qt_signals.data_sniffed.emit(old_nmsgs) if self.sniff_file and not os.path.isdir(self.sniff_file): - with open(self.sniff_file, "a") as myfile: - myfile.write("\n".join(self.plain_bits_str)) + plain_bits_str = self.plain_bits_str + if plain_bits_str: + with open(self.sniff_file, "a") as f: + f.write("\n".join(plain_bits_str) + "\n") if not self.__store_data: self.messages.clear()