Job viewer shows "Printer error" for cups-waiting-for-job-completed

未关闭 适合新手
#494 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@RonitMehta08 已经在做这个了。

开始于 2026年11月13日。

  • #500 来自 @RonitMehta08 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
desktop

调研方向

阅读 statereason.py,尤其是 StateReason.get_level(),并追踪 jobviewer.py 如何在 JobViewer.update_status() 中使用原因级别。将指定的 CUPS 原因添加到信息分类中,然后检查作业等待完成时状态栏不再报告错误。该 issue 没有指定测试文件。

由索引模型根据 Issue 内容生成。

描述

Note: This issue was written by my clanker. While I try to verify its steps as much as possible, it might not be 100% correct.


Summary

At the end of each job sent to an IPP printer, the job viewer's status bar shows "Printer error", even though the job prints and completes successfully.

Cause

  • After sending the document, the CUPS ipp backend sets the printer-state-reason cups-waiting-for-job-completed while it waits for the printer to finish (cups backend/ipp.c). CUPS clears it in finalize_job once the job is done.
  • StateReason.get_level() classifies every reason without a -report or -warning suffix, and not in its explicit list, as ERROR. So this normal reason becomes an error titled "Printer error".
  • JobViewer.update_status() pushes the worst reason's description to the status bar, so the error is shown while the job finishes.
  • #72 already added this reason to the blacklist in notify_printer_state_reason_if_important(), so desktop notifications are suppressed, but the status bar path still uses the ERROR level.

Steps to reproduce

  1. Use a driverless IPP printer (here via a cups-browsed implicitclass:// queue; any ipp/ipps queue uses the same backend code path).
  2. Open the job viewer: system-config-printer --show-jobs <queue>.
  3. Print a multi-page document.
  4. When all data has been sent and the printer is still printing, the status bar shows "Printer error".

Expected: no error; the job completes normally.
Actual: "Printer error" while the backend waits for completion. The job ends as completed and the printer reports job-completed-successfully.

Suggested fix

Classify the reason as REPORT in StateReason.get_level(), next to the other cups-* informational reasons. This fixes the status bar and the notification path at their shared source:

         if (self.reason.endswith ("-report") or
             self.reason in ["connecting-to-device",
+                            "cups-waiting-for-job-completed",
                             "cups-ipp-missing-cancel-job",

Environment

  • system-config-printer 1.5.18 (Ubuntu package 1.5.18-1ubuntu9), code unchanged on master at c40cbbb
  • CUPS 2.4.7, cups-browsed 2.0.0
  • Linux Mint 22.3 (Cinnamon)
  • Printer: HP Color LaserJet Pro MFP 3302 (IPPS)
主要语言
Python
星标
209
派生
111
平均合并
2 天 3 小时
30 天内合并 PR
8

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenPrinting/system-config-printer 的其他 Issue

查看 OpenPrinting/system-config-printer 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。