![尝试打印时出现 Python 错误](https://linux22.com/image/1200914/%E5%B0%9D%E8%AF%95%E6%89%93%E5%8D%B0%E6%97%B6%E5%87%BA%E7%8E%B0%20Python%20%E9%94%99%E8%AF%AF.png)
我已经运行 ubuntu 22.04 一段时间了,打印了很多东西。突然间,我无法打印了。我在 /var/log 中看到以下错误。有人能帮我吗?
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/printerproperties.py", line 1425, in load
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: option.reinit (value, supported=supported)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 368, in reinit
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: OptionAlwaysShown.reinit (self, original_value, supported=supported)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 229, in reinit
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.set_widget_value (self.original_value)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 254, in set_widget_value
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: index = self.combobox_map.index (ipp_value)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: ValueError: 0 is not in list
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: Continuing anyway..
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: Caught non-fatal exception. Traceback:
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/printerproperties.py", line 1425, in load
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: option.reinit (value, supported=supported)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 229, in reinit
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.set_widget_value (self.original_value)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 254, in set_widget_value
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: index = self.combobox_map.index (ipp_value)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: ValueError: 0 is not in list
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: Continuing anyway..
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: Traceback (most recent call last):
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/system-config-printer.py", line 1844, in on_edit_activate
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.dests_iconview_item_activated (self.dests_iconview, paths[0])
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/system-config-printer.py", line 597, in dests_iconview_item_activated
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.propertiesDlg.show (name, host=self.connect_server,
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/printerproperties.py", line 579, in show
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.load (name, host=host, encryption=encryption, parent=parent)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/printerproperties.py", line 1456, in load
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: self.add_job_option (option, value=value,
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/printerproperties.py", line 835, in add_job_option
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: option = options.OptionWidget(name, value, supported,
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 100, in OptionWidget
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: return OptionSelectOneNumber(name, v, s, on_change)
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: File "/usr/share/system-config-printer/options.py", line 426, in __init__
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: debugprint("Selecting from choices:", supported[0])
Mar 21 10:20:41 birch org.gnome.ControlCenter.SearchProvider[253288]: TypeError: debugprint() takes 1 positional argument but 2 were given
Mar 21 10:20:41 birch dbus-daemon[897]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested
by ':1.754' (uid=1000 pid=253288 comm="/usr/bin/python3 /usr/share/system-config-printer/" label="unconfined")
答案1
好吧,我做了一些在发布问题之前应该做的事情。我删除了打印机并重新添加了它。现在一切正常。抱歉增加了噪音。