[elbe-devel] [PATCH] elbepack: handle ValueError from Debian 822 parsing

Benedikt Spranger b.spranger at linutronix.de
Fri Feb 23 17:01:39 CET 2024


Am Mon, 12 Feb 2024 12:55:27 +0100
schrieb Thomas Weißschuh <thomas.weissschuh at linutronix.de>:

> When a duplicate field in a copyright file is parsed this will be
> reported as ValueError.
> For example debian/copyright from elfutils (0.188-2.1):
> 
> ```
> File debian/_deb822_repro/parsing.py:3112, in parse_deb822_file(sequence, accept_files_with_error_tokens, accept_files_with_duplicated_fields, encoding)
>    3110             if dup_field is not None:
>    3111                 msg = 'Duplicate field "{dup_field}" in paragraph number {no}'
> -> 3112                 raise ValueError(msg.format(dup_field=dup_field, no=no))
>    3114 return deb822_file
> 
> ValueError: Duplicate field "Comment" in paragraph number 2
> ```
> 
> Handle ValueError the same as the other exceptions.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
Reviewed-by: Benedikt Spranger <b.spranger at linutronix.de>


More information about the elbe-devel mailing list