Skip to content

Added optional argument to decode method to allow binary data decoded - #45

Open
kurtjensen wants to merge 1 commit into
NaturalHistoryMuseum:masterfrom
kurtjensen:binary-decode
Open

Added optional argument to decode method to allow binary data decoded#45
kurtjensen wants to merge 1 commit into
NaturalHistoryMuseum:masterfrom
kurtjensen:binary-decode

Conversation

@kurtjensen

Copy link
Copy Markdown

Hi,
I needed to be able to decode datamatrix codes that were originally encoded with the base256 scheme, but the current decoding support was only for strings. Zero bytes in the payload were problematic. So, I added an optional argument binary= to the decode() call.
I'm using Python 3.6 under ubuntu 18.04 for my development. It seems to pass the existing tests in the tests folder on my box, but I don't know if I created a regression for other platforms or Python versions.
I also did not expand the tests to cover binary payload.
I'm not sure if this is the best way to accomplish what I attempted, but it seems to work for me.
This is my first pull request, so I hope I did it correctly. Thanks!
-Kurt

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 96.075% when pulling 8700a05 on kurtjensen:binary-decode into a425ec3 on NaturalHistoryMuseum:master.

4 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 96.075% when pulling 8700a05 on kurtjensen:binary-decode into a425ec3 on NaturalHistoryMuseum:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 96.075% when pulling 8700a05 on kurtjensen:binary-decode into a425ec3 on NaturalHistoryMuseum:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 96.075% when pulling 8700a05 on kurtjensen:binary-decode into a425ec3 on NaturalHistoryMuseum:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 96.075% when pulling 8700a05 on kurtjensen:binary-decode into a425ec3 on NaturalHistoryMuseum:master.

@Noordsestern

Copy link
Copy Markdown

Excellent. This fix is exactly what we were looking for. Thank you! We have several zero bytes in our data matrix.

@Noordsestern

Copy link
Copy Markdown

We are using this fix for 6 months now. Maybe it is worthwile merging this pull request despite the slide coverage loss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants