OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
160 stars 88 forks source link

lpd queue names printed on the console #132

Closed bigon closed 4 years ago

bigon commented 5 years ago

<Hi,

When trying to add a printer by searching for it using its IP address, s-c-p is trying to probe the different lpd queues:

lpd: trying Device lpd://C0000406.example.com/print added to physical device: <PhysicalDevice.PhysicalDevice (KONICA MINOLTA,C368Series,,10.155.14.14,None,lpd://C0000406.example.com/print)> PASSTHRU '\x00' Device found: lpd://c0000406/PASSTHRU Device lpd://c0000406/PASSTHRU added to physical device: <PhysicalDevice.PhysicalDevice (,,,10.155.14.14,None,lpd://c0000406/PASSTHRU)> ps '\x00' Device found: lpd://c0000406/ps Device lpd://c0000406/ps added to physical device: <PhysicalDevice.PhysicalDevice (,,,10.155.14.14,None,lpd://c0000406/ps)> lp '\x00' Device found: lpd://c0000406/lp Device lpd://c0000406/lp added to physical device: <PhysicalDevice.PhysicalDevice (,,,10.155.14.14,None,lpd://c0000406/lp)> PORT1 '\x00' Device found: lpd://c0000406/PORT1 Device lpd://c0000406/PORT1 added to physical device: <PhysicalDevice.PhysicalDevice (,,,10.155.14.14,None,lpd://c0000406/PORT1)> [...]

As you can see it prints strings like "PASSTHRU" and null characters. The problem is that these are printed even when s-c-p is not started with debug. This is spamming the logs/console

bigon commented 5 years ago

This is happening because of the print() in the probe_queue() method https://github.com/zdohnal/system-config-printer/blob/master/probe_printer.py#L133 and https://github.com/zdohnal/system-config-printer/blob/master/probe_printer.py#L138

zdohnal commented 5 years ago

Hi Laurent! Thank you for reporting the issue! It seems these print() calls was meant as some kind of debug output... the commit which added it is from 2007, so that is only my guess... Would you mind testing the fix? I'll change those print() to debugprint(), it should not make any harm...

zdohnal commented 5 years ago

Fixed by https://github.com/zdohnal/system-config-printer/commit/83856b9f4f37fe0df0ec23ced15b6f62109f64e2

zdohnal commented 5 years ago

I'll leave the issue open, feel free to verify it.