Skip to content

Commit

Permalink
Ignore binary files
Browse files Browse the repository at this point in the history
  • Loading branch information
ejucovy committed Sep 5, 2019
1 parent 9d53ab5 commit 5b8d77e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion multireposearch/sqlindexer.py
Expand Up @@ -65,7 +65,13 @@ def reindex_repository(self, reponame, modified=None):
content = node.get_content()
if content is None:
continue
content = mimeview.to_unicode(content.read(), node.get_content_type())
content = content.read()
content_type = node.get_content_type()
if mimeview.is_binary(content=content, mimetype=content_type):
continue
content = mimeview.to_unicode(
content, node.get_content_type()
).encode("utf-8")

cursor.execute("""
DELETE FROM repository_node
Expand Down

0 comments on commit 5b8d77e

Please sign in to comment.