Skip to content

Treat SQLite DB and mostly binaries as binaries #43 #44

Merged
pydanny merged 2 commits intobinaryornot:masterfrom
pombredanne:43-sqlite-and-more
Aug 11, 2019
Merged

Treat SQLite DB and mostly binaries as binaries #43 #44
pydanny merged 2 commits intobinaryornot:masterfrom
pombredanne:43-sqlite-and-more

Conversation

@pombredanne
Copy link
Copy Markdown
Contributor

@pombredanne pombredanne commented Aug 9, 2019

This PR fixes #43

Signed-off-by: Philippe Ombredanne pombredanne@nexb.com

@pombredanne
Copy link
Copy Markdown
Contributor Author

@audreyr BTW do you need help with the maintenance of this project?

@pombredanne
Copy link
Copy Markdown
Contributor Author

Let me revert the Appevyor config changes. :|

@pydanny
Copy link
Copy Markdown
Collaborator

pydanny commented Aug 10, 2019

@pombredanne Thank you for this effort so far!

Work has given me the chance to support this and other Cookiecutter-related projects going forward. Any help you give toward maintaining the project will be greatly appreciated.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
nontext_ratio2 = float(len(high_chars)) / float(len(bytes_to_check))
logger.debug('nontext_ratio2: %(nontext_ratio2)r', locals())

if nontext_ratio1 > 0.90 and nontext_ratio2 > 0.90:
Copy link
Copy Markdown
Contributor Author

@pombredanne pombredanne Aug 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rationale is that if this is mostly non-ascii (e.g non-printable low and high bytes) then this is treated as a binary.

@pombredanne
Copy link
Copy Markdown
Contributor Author

@pydanny re:

Work has given me the chance to support this and other Cookiecutter-related projects going forward. Any help you give toward maintaining the project will be greatly appreciated.

Sure thing! binaryornot is used in scancode-toolkit which is a somewhat popular open source license and copyright scanner so it sees a lot of files. There are some weirdness I noticed recently and I will likely come with a few more tweaks

@pydanny pydanny merged commit 19790a4 into binaryornot:master Aug 11, 2019
@pombredanne pombredanne deleted the 43-sqlite-and-more branch August 11, 2019 13:06
@pombredanne
Copy link
Copy Markdown
Contributor Author

@pydanny do you mind to tag and push a release to Pypi?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A sqlite DB is detected as not a binary

2 participants