[Python-ideas] os.path.isbinary

Chris Kaynor ckaynor at zindagigames.com
Wed Jul 31 23:29:38 CEST 2013


>
> Besides the high chance of false positives, what makes this method (and
>> the problem it tries to solve) so so difficult is that binary files may
>> contain what is considered to be large amounts of text, and text files may
>> contain pieces of binary data.
>> For example, consider a windows executable file - Much of the data in
>> such a file is considered binary data, but there are defined sections where
>> strings and text resources are stored. Any heuristic algorithm like the one
>> mentioned will be insufficient in such cases.
>> Although I can't think of a situation off hand where the opposite may be
>> true (binary data embedded in what is considered to be a text file) I'm
>> pretty sure such a situation exists.
>>
>
> One could consider PDF to be such a format (text with embedded binary
> data).
>
>
RTF is another example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130731/bf089d79/attachment-0001.html>


More information about the Python-ideas mailing list