From 1f2f293778708d6219151bc63cc7f25db5dd8771 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 25 Jul 2019 16:34:00 +0000 Subject: [PATCH] Redirect mercury-parser.js stderr to stdout. Moreover, if an error occurs while parsing a link from an RSS feed we should report the link that raised the error, not the URL of the parent feed --- platypush/backend/http/request/rss/__init__.py | 2 +- platypush/plugins/http/webpage/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/request/rss/__init__.py b/platypush/backend/http/request/rss/__init__.py index 209e43a2a..d20dc35f7 100644 --- a/platypush/backend/http/request/rss/__init__.py +++ b/platypush/backend/http/request/rss/__init__.py @@ -146,7 +146,7 @@ class RssUpdates(HttpRequest): break except Exception as e: self.logger.warning('Exception encountered while parsing RSS ' + - 'RSS feed {}: {}'.format(self.url, str(e))) + 'RSS feed {}: {}'.format(entry.link, str(e))) self.logger.exception(e) source_record.last_updated_at = parse_start_time diff --git a/platypush/plugins/http/webpage/__init__.py b/platypush/plugins/http/webpage/__init__.py index a0bdcbd69..333d7850e 100644 --- a/platypush/plugins/http/webpage/__init__.py +++ b/platypush/plugins/http/webpage/__init__.py @@ -55,7 +55,7 @@ class HttpWebpagePlugin(Plugin): """ self.logger.info('Parsing URL {}'.format(url)) - parser = subprocess.Popen(['node', self._mercury_script, url], stdout=subprocess.PIPE) + parser = subprocess.Popen(['node', self._mercury_script, url], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) response = parser.stdout.read().decode() try: