Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

makes the bmp format python 3 compatible #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swoertz
Copy link

@swoertz swoertz commented May 27, 2014

A bitmap file has to be opened in "rb" mode in python 3, but then b'BM' != 'BM'. Hence the parse function raises an error. This fix should do the trick. Tested with python2.7.6 and python3.4.0

A bitmap file has to be opened in "rb" mode in python 3, but then b'BM' != 'BM'. Hence the parse function raises an error. This fix should do the trick. Tested with python2.7.6 and python3.4.0
@tomerfiliba
Copy link

@swoertz -- please submit pull requests to https://github.com/construct/construct (the official repo)
also, be sure to use from construct.lib.py3compat import str2bytes and str2bytes("BM") instead of literal byte strings, as it won't work on older pythons

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants