Christian Heimes <li...@cheimes.de> added the comment:

startswith supports bytes just fine:

$ python3
Python 3.6.6 (default, Jul 19 2018, 14:25:17) 
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('test.png', 'rb') as f:
...     header = f.read(1024)
... 
>>> header.startswith(b'\211PNG\r\n\032\n')
True

----------
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34787>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to