-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError raised when parsing gtin in 3.2.0 #295
Comments
I'm on vacation right now, but will get back to you on this one once I'm back. |
jodal
added a commit
that referenced
this issue
Jul 29, 2024
In the latest GS1 Application Identifier dataset, there are four AIs with optional pattern groups. When the value matches everything but the optional pattern group, the group's value becomes `None`. This caused Biip to crashed when we tried building a string of the characters matching the pattern. Fixes #295
I've release Biip 3.3.0 with a fix for this issue. >>> from pprint import pprint
>>> import biip
>>> pprint(biip.parse("701197206489"))
ParseResult(value='701197206489',
symbology_identifier=None,
gtin=Gtin(value='701197206489',
format=GtinFormat.GTIN_12,
prefix=GS1Prefix(value='070', usage='GS1 US'),
company_prefix=GS1CompanyPrefix(value='0701197'),
payload='70119720648',
check_digit=9,
packaging_level=None),
gtin_error=None,
upc=Upc(value='701197206489',
format=UpcFormat.UPC_A,
number_system_digit=7,
payload='70119720648',
check_digit=9),
upc_error=None,
sscc=None,
sscc_error="Failed to parse '701197206489' as SSCC: Expected 18 "
'digits, got 12.',
gs1_message=None,
gs1_message_error='Failed to parse GS1 AI (7011) date/time from '
"'972064'.") |
Awesome work @jodal. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I tried parsing the same gtin value in 3.1.0 and 3.2.0 and it seems that 3.2.0 is raising an unhandled exception. Maybe this is related to #292?
3.1.0
, it's working fine:3.2.0
, it's raisingTypeError
The text was updated successfully, but these errors were encountered: