You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
With 3.1.0, it's working fine:
python
Python 3.12.0 (main, Oct 30 2023, 16:10:32) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import biip
>>> 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 get GS1 Application Identifier from '701197206489'.")
With 3.2.0, it's raising TypeError
$ python
Python 3.12.0 (main, Oct 30 2023, 16:10:32) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import biip
>>> biip.parse("701197206489")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/test/.venv/lib/python3.12/site-packages/biip/_parser.py", line 89, in parse
parse_func(val, config, queue, result)
File "~/test/.venv/lib/python3.12/site-packages/biip/_parser.py", line 236, in _parse_gs1_message
result.gs1_message = GS1Message.parse(
^^^^^^^^^^^^^^^^^
File "~/test/.venv/lib/python3.12/site-packages/biip/gs1/_messages.py", line 76, in parse
element_string = GS1ElementString.extract(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/test/.venv/lib/python3.12/site-packages/biip/gs1/_element_strings.py", line 151, in extract
value = "".join(pattern_groups)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 1: expected str instance, NoneType found
The text was updated successfully, but these errors were encountered:
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: