system-config-printer can't open printer properties because job-cancel-after value is None
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
printerproperties.py の add_job_option から始め、次に traceback が値を int() で変換している options.py の OptionWidget 周辺を調べます。プリンターのプロパティを開いて失敗を再現し、job-cancel-after の None 値の処理をレポートで提案されている 2 つの修正と比較します。プロパティダイアログが 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時間
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信