This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, lorenzogotuned
Date 2018-09-24.14:25:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537799124.69.0.956365154283.issue34787@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-09-24 14:25:24christian.heimessetrecipients: + christian.heimes, lorenzogotuned
2018-09-24 14:25:24christian.heimessetmessageid: <1537799124.69.0.956365154283.issue34787@psf.upfronthosting.co.za>
2018-09-24 14:25:24christian.heimeslinkissue34787 messages
2018-09-24 14:25:24christian.heimescreate