#1033981 command-not-found: Incompatible with deb822 apt sources

#1033981#5
Date:
2023-04-05 14:41:58 UTC
From:
To:
After changing the /etc/apt/sources.d/… files from the traditional to the deb822 format following noisy warning message
are displayed:
WARNING:root:could not open file '/etc/apt/sources.list.d/bookworm.security.sources': Unable to parse section data
Same for all other sources files in deb822 format.

Content of the mentioned file.

# -- old-stable --
Types: deb
URIs: http://security.debian.org/debian-security
Suites: bullseye-security
Components: main contrib non-free

# -- stable --

Types: deb
URIs: http://security.debian.org/debian-security
Suites: bookworm-security
Components: main contrib non-free  non-free-firmware
-------------------------------------------------------------------------------

H.-Dirk_Schmitt
Dipl.Math.
eMail:dirk.schmitt@computer42.org
pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html

#1033981#10
Date:
2023-04-05 15:21:37 UTC
From:
To:
Control: reassign -1 python-apt
Control: retitle -1 python-apt: deb822 sources parsing inconsistency

23.04.0 is the version I introduced deb822 support, so yes, it
absolutely does support it, older versions ignore the files.

The warning says the file is wrong (or the parser).

I think you may be missing an empty line at the end or your comments
trip up the parser. It is generally expected that comments are part
of sections and there are no fraudulent sections that consist of just
comments.

#1033981#21
Date:
2023-04-06 11:28:04 UTC
From:
To:
Am Mittwoch, dem 05.04.2023 um 17:21 +0200 schrieb Julian Andres Klode:

I think the parser in incorrect.
The file is processed by apt correctly.

IMHO should the simple 'bash-like' comment format nether confuse a
parser. This comment line  can be eleminated before the content parsing
is done.


I attached the whole content of my /apt/sources.list.d.