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

makes the bmp format python 3 compatible#25

Open
swoertz wants to merge 1 commit intoMostAwesomeDude:masterfrom
swoertz:patch-1
Open

makes the bmp format python 3 compatible#25
swoertz wants to merge 1 commit intoMostAwesomeDude:masterfrom
swoertz:patch-1

Conversation

@swoertz
Copy link
Copy Markdown

@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
Copy Markdown

@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