Skip to content

Conversation

@claui
Copy link
Contributor

@claui claui commented Jan 11, 2026

In python-barcode v0.16.0, the API of the BaseWriter constructor was narrowed so two of its callbacks can no longer be None (see issue #123.)

Given we override the implementation that would use those callbacks anyway, this PR passes dummy callbacks. This ensures compatibility with both pre-v0.16 and newer versions of python-barcode.

Additionally, loosen one of the assertions where the upstream wording of an error message slightly changed.

Fixes #123.

/cc @blaisegarant, @maresb

In python-barcode [1] v0.16.0, the API of the BaseWriter constructor was
narrowed [2] so two of its callbacks can no longer be None (see
issue labelle-org#123 [3].)

Given we override the implementation that would use those callbacks
anyway, pass dummy callbacks. This ensures compatibility with both
pre-v0.16 and newer versions of python-barcode.

Additionally, loosen one of the assertions where the upstream wording of
an error message slightly changed.

Fixes labelle-org#123.

[1]: https://pypi.org/project/python-barcode/

[2]: WhyNotHugo/python-barcode@v0.15.1...v0.16.0#diff-01c9de34453d29913aa28bb39e4c847e2ecf95cf81b1264c2759090f870152c9

[3]: labelle-org#123

Reported-by: @blaisegarant
@maresb maresb merged commit fb21ae8 into labelle-org:main Jan 11, 2026
6 checks passed
@maresb
Copy link
Contributor

maresb commented Jan 11, 2026

Thanks @claui for tracking this down!

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.

python-barcode breaking change

2 participants