[Bug 1898891] Re: anacron cron.weekly error: AttributeError: module 'platform' has no attribute 'linux_distribution'
paul fox
1898891 at bugs.launchpad.net
Sun Oct 11 11:45:33 UTC 2020
Adding a "me too". Upgraded from 18 to 20 (both LTS) and am now getting
this same error (with identical traceback as above).
It seems that /usr/share/software-
center/softwarecenter/distro/__init__.py calls
platform.linux_distribution(), which no longer exists.
>From stackoverflow (where all of my knowledge of python resides), I find this, at https://stackoverflow.com/questions/63636697/error-module-platform-has-no-attribute-linux-distribution :
"Python 3.8 removed the "linux_distribution()" function from the platform module. It is replaced by the equivalent in the "distro" module (distro is not built-in to Python and must be installed via pip)."
For me, since I don't believe I've ever once used the index built by
apt-xapian-index, and it's only a recommendation, I've simply removed
the package.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to anacron in Ubuntu.
https://bugs.launchpad.net/bugs/1898891
Title:
anacron cron.weekly error: AttributeError: module 'platform' has no
attribute 'linux_distribution'
Status in anacron package in Ubuntu:
Confirmed
Bug description:
Ever since upgrading to Xubuntu 20.04, anacron throws the following error weekly. This seems to be a common problem reported on the web regarding python 3.8. Apparently some file or library is outdated, but I have not seen this error reported in relation to anacron.
----------------------------------------------
Subject: Anacron job 'cron.weekly' on <machine>.com
/etc/cron.weekly/apt-xapian-index:
ERROR:root:DebFileApplication import
Traceback (most recent call last):
File "/usr/share/software-center/softwarecenter/db/__init__.py", line 6, in
<module>
from .debfile import DebFileApplication, DebFileOpenError
File "/usr/share/software-center/softwarecenter/db/debfile.py", line 25, in
<module>
from softwarecenter.db.application import Application, AppDetails
File "/usr/share/software-center/softwarecenter/db/application.py", line 28,
in <module>
import softwarecenter.distro
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 201,
in <module>
distro_instance = _get_distro()
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 168,
in _get_distro
distro_info = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'
Traceback (most recent call last):
File "/usr/sbin/update-apt-xapian-index", line 104, in <module>
if not indexer.setupIndexing(force=opts.force, system=opts.pkgfile is None):
File "/usr/lib/python3/dist-packages/axi/indexer.py", line 473, in
setupIndexing
self.plugins = Plugins(progress=self.progress, system=system)
File "/usr/lib/python3/dist-packages/axi/indexer.py", line 98, in __init__
addon = Addon(fullname, **kw)
File "/usr/lib/python3/dist-packages/axi/indexer.py", line 53, in __init__
self.module = imp.load_source("axi.plugin_" + self.name, fname)
File "/usr/lib/python3.8/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/share/apt-xapian-index/plugins/software_center.py", line 13, in
<module>
from softwarecenter.db.update import (
File "/usr/share/software-center/softwarecenter/db/update.py", line 33, in
<module>
from softwarecenter.backend.scagent import SoftwareCenterAgent
File "/usr/share/software-center/softwarecenter/backend/scagent.py", line 30,
in <module>
from softwarecenter.distro import get_distro, get_current_arch
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 201,
in <module>
distro_instance = _get_distro()
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 168,
in _get_distro
distro_info = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'
run-parts: /etc/cron.weekly/apt-xapian-index exited with return code 1
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/1898891/+subscriptions
More information about the foundations-bugs
mailing list