Skip to content

Crash when app has no reviews #11

Description

@robincalmegard

When trying to fetch reviews for an app and an language where the number of reviews is currently 0, critics crashes with the following stack trace:
Traceback (most recent call last): File "/usr/local/bin/critics", line 9, in <module> load_entry_point('critics==0.3.0', 'console_scripts', 'critics')() File "/usr/local/lib/python2.7/dist-packages/critics-0.3.0-py2.7.egg/critics/__init__.py", line 9, in main return cli(auto_envvar_prefix=envvar_prefix) File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/critics-0.3.0-py2.7.egg/critics/commands.py", line 82, in cli app.poll_store('android', notify=notify) File "/usr/local/lib/python2.7/dist-packages/critics-0.3.0-py2.7.egg/critics/core.py", line 41, in poll_store self.poll_store_single_app(platform, app_id, language, notify) File "/usr/local/lib/python2.7/dist-packages/critics-0.3.0-py2.7.egg/critics/core.py", line 55, in poll_store_single_app limit=self.settings.get('parse_max_entries', None)) File "/usr/local/lib/python2.7/dist-packages/critics-0.3.0-py2.7.egg/critics/parsers.py", line 79, in get_android_reviews doc = html.fromstring(response_as_html.encode('utf-8'), parser=utf8_parser) File "/usr/local/lib/python2.7/dist-packages/lxml/html/__init__.py", line 876, in fromstring doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) File "/usr/local/lib/python2.7/dist-packages/lxml/html/__init__.py", line 762, in document_fromstring value = etree.fromstring(html, parser, **kw) File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:79010) File "src/lxml/parser.pxi", line 1848, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118341) File "src/lxml/parser.pxi", line 1736, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:117021) File "src/lxml/parser.pxi", line 1102, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:111265) File "src/lxml/parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:105109) File "src/lxml/parser.pxi", line 706, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:106817) File "src/lxml/parser.pxi", line 646, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:105963) File "<string>", line 0 lxml.etree.XMLSyntaxError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions