Message326239
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 |
|
Date |
User |
Action |
Args |
2018-09-24 14:25:24 | christian.heimes | set | recipients:
+ christian.heimes, lorenzogotuned |
2018-09-24 14:25:24 | christian.heimes | set | messageid: <1537799124.69.0.956365154283.issue34787@psf.upfronthosting.co.za> |
2018-09-24 14:25:24 | christian.heimes | link | issue34787 messages |
2018-09-24 14:25:24 | christian.heimes | create | |
|