From a924442f4325301a5e97beb761f86c92adcd43c8 Mon Sep 17 00:00:00 2001 From: Martijn de Vos Date: Thu, 25 Jan 2018 08:50:04 +0100 Subject: [PATCH 1/3] Hiding console on Windows and macOS --- tribler.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tribler.spec b/tribler.spec index 0044f7a6605..1b1186cf071 100644 --- a/tribler.spec +++ b/tribler.spec @@ -58,7 +58,7 @@ exe = EXE(pyz, debug=False, strip=False, upx=True, - console=True, + console=False, icon='Tribler/Main/Build/Win/tribler.ico') coll = COLLECT(exe, a.binaries, @@ -72,7 +72,7 @@ app = BUNDLE(coll, icon='Tribler/Main/Build/Mac/tribler.icns', bundle_identifier='nl.tudelft.tribler', info_plist={'NSHighResolutionCapable': 'True', 'CFBundleInfoDictionaryVersion': 1.0, 'CFBundleVersion': version_str, 'CFBundleShortVersionString': version_str}, - console=True) + console=False) # Remove libvlc - conflicts on Windows if sys.platform == 'win32': From d0a514e77b8f260ae9fe0fa9598395b41dbc255f Mon Sep 17 00:00:00 2001 From: Martijn de Vos Date: Thu, 25 Jan 2018 09:33:23 +0100 Subject: [PATCH 2/3] Fixed crash when using RSS functionality --- Tribler/Core/Modules/channel/channel_rss.py | 6 +++++- .../Test/Core/Modules/Channel/test_channel_rss.py | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Tribler/Core/Modules/channel/channel_rss.py b/Tribler/Core/Modules/channel/channel_rss.py index 889a766597d..047546627e9 100644 --- a/Tribler/Core/Modules/channel/channel_rss.py +++ b/Tribler/Core/Modules/channel/channel_rss.py @@ -8,7 +8,7 @@ from Tribler.Core.Utilities.utilities import http_get from twisted.internet import reactor -from twisted.internet.defer import DeferredList +from twisted.internet.defer import DeferredList, succeed from twisted.web.client import getPage from Tribler.dispersy.taskmanager import TaskManager @@ -87,6 +87,10 @@ def parse_feed(self): rss_parser = RSSFeedParser() def on_rss_items(rss_items): + if not rss_items: + self._logger.warning(u"No RSS items found.") + return succeed(None) + def_list = [] for rss_item in rss_items: if self._to_stop: diff --git a/Tribler/Test/Core/Modules/Channel/test_channel_rss.py b/Tribler/Test/Core/Modules/Channel/test_channel_rss.py index 5694adab435..07dcfb7fda2 100644 --- a/Tribler/Test/Core/Modules/Channel/test_channel_rss.py +++ b/Tribler/Test/Core/Modules/Channel/test_channel_rss.py @@ -73,13 +73,24 @@ def test_parse_rss_feed(self): Test parsing a rss feed """ self.channel_rss.rss_url = 'http://localhost:%d/test_rss.xml' % self.file_server_port - self.channel_rss._url_cache = SimpleCache(os.path.join(self.session_base_dir, 'cache.txt')) def verify_rss(items): self.assertEqual(len(items), 2) return self.channel_rss.parse_feed().addCallback(verify_rss) + @deferred(timeout=10) + def test_parse_no_rss(self): + """ + Test parsing a non-rss feed + """ + self.channel_rss.rss_url = 'http://localhost:%d/test_rsszz.xml' % self.file_server_port + + def verify_rss(items): + self.assertIsNone(items) + + return self.channel_rss.parse_feed().addCallback(verify_rss) + @deferred(timeout=10) def test_parse_feed_stopped(self): """ From 1f186eb8e9511322fc5ebf1a38351722f79d4f00 Mon Sep 17 00:00:00 2001 From: Martijn de Vos Date: Thu, 25 Jan 2018 09:36:16 +0100 Subject: [PATCH 3/3] Lowered logging level in tunnel community --- Tribler/community/tunnel/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tribler/community/tunnel/routing.py b/Tribler/community/tunnel/routing.py index f1941caaaf0..9c759ba63ef 100644 --- a/Tribler/community/tunnel/routing.py +++ b/Tribler/community/tunnel/routing.py @@ -95,7 +95,7 @@ def tunnel_data(self, destination, payload): @param str payload: the packet's payload """ - self._logger.info("Tunnel data (len %d) to end for circuit %s with ultimate destination %s", len(payload), + self._logger.debug("Tunnel data (len %d) to end for circuit %s with ultimate destination %s", len(payload), self.circuit_id, destination) num_bytes = self.proxy.send_data([Candidate(self.first_hop, False)], self.circuit_id, destination, ('0.0.0.0', 0), payload)