system-config-printer can't open printer properties because job-cancel-after value is None
维护者通常 2 天内回复
评估
调研方向
从 printerproperties.py 的 add_job_option 开始,然后检查 options.py 中 OptionWidget 附近的代码,traceback 会在那里使用 int() 转换值。打开某台打印机的打印机属性来复现故障,并将 job-cancel-after 的 None 值处理方式与报告中提出的两种修复方案进行比较;当属性对话框能够在没有 traceback 的情况下打开时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I have system-config-printer 1.5.18-3 from Debian Testing. All my other CUPS etc. packages are up-to-date.
When I run system-config-printer, unlock it, and try to open the properties for a printer, nothing happens in the UI. In the terminal window from which I started system-config-printer I see a stack trace:
Traceback (most recent call last):
File "/usr/share/system-config-printer/system-config-printer.py", line 597, in dests_iconview_item_activated
self.propertiesDlg.show (name, host=self.connect_server,
File "/usr/share/system-config-printer/printerproperties.py", line 579, in show
self.load (name, host=host, encryption=encryption, parent=parent)
File "/usr/share/system-config-printer/printerproperties.py", line 1457, in load
self.add_job_option (option, value=value,
File "/usr/share/system-config-printer/printerproperties.py", line 836, in add_job_option
option = options.OptionWidget(name, value, supported,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/system-config-printer/options.py", line 84, in OptionWidget
v = int(v)
^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
I modified printerproperties.py to indicate what option name and value are being processed right before this stack trace happens, and it said it was job-cancel-after with a value of None.
I don't know if this is the correct fix, but I made the problem go away with this change:
--- printerproperties.py~ 2024-06-06 11:58:59.000000000 -0400
+++ printerproperties.py 2024-12-28 20:26:43.889878034 -0500
@@ -832,7 +832,7 @@
def add_job_option(self, name, value = "", supported = "", is_new=True,
editable=True):
try:
- option = options.OptionWidget(name, value, supported,
+ option = options.OptionWidget(name, value or "", supported,
self.option_changed)
except ValueError:
# We can't deal with this option type for some reason.
I suppose another option would be to change the except statement there from ValueError to (ValueError, TypeError).
- 主要语言
- Python
- 星标
- 209
- 派生
- 111
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 8
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenPrinting/system-config-printer 的其他 Issue
-
Job viewer shows "Printer error" for cups-waiting-for-job-completed可能已有人在做 @RonitMehta08 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
OpenPrinting/system-config-printer#494 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 44/100
OpenPrinting/system-config-printer#499 ·
维护者通常 2 天内回复
-
[Release Tracking] system-config-printer 1.5.19 milestone可能已有人在做 @alexpevzner 于 16 天前认领。 未关闭
OpenPrinting/system-config-printer#492 · 1 条评论 · 已指派 2 人 ·
维护者通常 2 天内回复
-
Scanner未关闭
难度 3/5 1-2 天 新手友好度 25/100
OpenPrinting/system-config-printer#407 · 1 条评论 ·
维护者通常 2 天内回复
-
Doesn't run with PYTHONSAFEPATH enabled可能已有人在做 @xovishnukosuri 于 250 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 58/100
OpenPrinting/system-config-printer#387 ·
维护者通常 2 天内回复
查看 OpenPrinting/system-config-printer 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 61/100
scverse/infercnvpy#238 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
skrub-data/skrub#2442 ·
维护者通常 1 天内回复
-
due_at is one hour late on the autumn DST change day (real-time delta added to a zoneinfo datetime)未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 77/100
open-feature/python-sdk-contrib#482 ·
维护者通常 1 天内回复
-
enhancement
难度 1/5 1 小时以内 新手友好度 94/100
warlock20/StartWithA#443 ·
维护者通常 1 天内回复