[Bug 1808337] [NEW] Codename is n/a

曲东方 qudongfang at gmail.com
Thu Dec 13 13:14:59 UTC 2018


Public bug reported:

Codename is `n/a` which is not right.
I noticed that codename is come from `_lsb_release()` in `aptsources/distro.py`.
However `lsb_release -a` may give a wrong result.
Maybe we could try `cat /etc/debian_version`. All Debian derives should have this file.

----------------------------------------
```bash
# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.6 (n/a)
Release:	9.6
Codename:	n/a

# cat /etc/debian_version 
buster/sid

# cut -f1 -d'/' /etc/debian_version
buster

# cat /etc/issue
Debian GNU/Linux buster/sid \n \l

# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux buster/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```

```python
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Debian/n/a
```

** Affects: python-apt (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "Fix invalid codename"
   https://bugs.launchpad.net/bugs/1808337/+attachment/5221962/+files/fix_invalid_codename.diff

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

Title:
  Codename is n/a

Status in python-apt package in Ubuntu:
  New

Bug description:
  Codename is `n/a` which is not right.
  I noticed that codename is come from `_lsb_release()` in `aptsources/distro.py`.
  However `lsb_release -a` may give a wrong result.
  Maybe we could try `cat /etc/debian_version`. All Debian derives should have this file.

  ----------------------------------------
  ```bash
  # lsb_release -a
  No LSB modules are available.
  Distributor ID:	Debian
  Description:	Debian GNU/Linux 9.6 (n/a)
  Release:	9.6
  Codename:	n/a

  # cat /etc/debian_version 
  buster/sid

  # cut -f1 -d'/' /etc/debian_version
  buster

  # cat /etc/issue
  Debian GNU/Linux buster/sid \n \l

  # cat /etc/os-release 
  PRETTY_NAME="Debian GNU/Linux buster/sid"
  NAME="Debian GNU/Linux"
  ID=debian
  HOME_URL="https://www.debian.org/"
  SUPPORT_URL="https://www.debian.org/support"
  BUG_REPORT_URL="https://bugs.debian.org/"
  ```

  ```python
  Traceback (most recent call last):
    File "/usr/bin/add-apt-repository", line 95, in <module>
      sp = SoftwareProperties(options=options)
    File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
      self.reload_sourceslist()
    File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
      self.distro.get_sources(self.sourceslist)    
    File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
      (self.id, self.codename))
  aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Debian/n/a
  ```

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



More information about the foundations-bugs mailing list