This appears to be a bug in python-apt. It fails to parse .sources files
which contain a comment paragraph which is not connect to a source
stanza (I think). I.e., this first scenario is fine:

root@mantic:~# cat /etc/apt/sources.list.d/ubuntu.sources 
# This comment is OK.
Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: mantic mantic-updates
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu
Suites: mantic-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
root@mantic:~# python3
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aptsources.sourceslist import SourcesList
>>> for e in SourcesList(deb822=True):
...     print(str(e))
... 
# This comment is OK.
Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: mantic mantic-updates
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu
Suites: mantic-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
>>> 

As opposed to this, which fails:

root@mantic:~# cat /etc/apt/sources.list.d/ubuntu.sources 
# This comment is NOT OK.

# This comment is OK.
Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: mantic mantic-updates
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu
Suites: mantic-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
root@mantic:~# python3
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aptsources.sourceslist import SourcesList
>>> for e in SourcesList(deb822=True):
...     print(str(e))
... 


WARNING:root:could not open file '/etc/apt/sources.list.d/ubuntu.sources': 
Unable to parse section data

>>>

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python-apt in Ubuntu.
https://bugs.launchpad.net/bugs/2047447

Title:
  No valid source.list found while upgrading from mantic to noble

Status in python-apt package in Ubuntu:
  New
Status in ubuntu-release-upgrader package in Ubuntu:
  Confirmed
Status in python-apt source package in Mantic:
  New
Status in ubuntu-release-upgrader source package in Mantic:
  New

Bug description:
  Checking package manager
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  Hit http://fr.archive.ubuntu.com/ubuntu mantic InRelease                      
                                                                                
                                                                                
                                                                              
  Hit http://fr.archive.ubuntu.com/ubuntu mantic-updates InRelease              
                                                                                
                                                                                
                                                                              
  Hit http://fr.archive.ubuntu.com/ubuntu mantic-security InRelease             
                                                                                
                                                                                
                                                                              
  Hit http://fr.archive.ubuntu.com/ubuntu mantic-backports InRelease            
                                                                                
                                                                                
                                                                              
  Hit https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu lunar InRelease       
                                                                                
                                                                                
                                                                              
  Fetched 0 B in 0s (0 B/s)                                                     
                                                                                
                                                                                
                                                                              
  Reading package lists... Done    
  Building dependency tree... Done 
  Reading state information... Done

  Checking for installed snaps

  Calculating snap size requirements

  Updating repository information

  No valid sources.list entry found

  While scanning your repository information no entry about mantic 
  could be found. 

  An upgrade might not succeed.

  Do you want to continue anyway?

  Continue [yN]

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/2047447/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to