system-config-printer/0001-encoding-Modified-to-use-utf-8-in-fdopen.patch
2018-10-15 17:39:39 +02:00

67 lines
5.8 KiB
Diff

From e7940de50a7164a2de82e003222ecbf8b10c9ad5 Mon Sep 17 00:00:00 2001
From: xoduddk123 <xoduddk123@naver.com>
Date: Wed, 20 Jun 2018 12:24:13 +0900
Subject: [PATCH] encoding: Modified to use utf-8 in fdopen()
The following error occurred due to encoding problem in fdopen().
root@tykwon:~# cat /var/log/syslog
2018-02-12T17:08:24.208317+09:00 tykwon kernel: usb 1-1.2: new high-speed USB device number 4 using dwc_otg
2018-02-12T17:08:24.309341+09:00 tykwon kernel: usb 1-1.2: New USB device found, idVendor=03f0, idProduct=3b2a
2018-02-12T17:08:24.309398+09:00 tykwon kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2018-02-12T17:08:24.309415+09:00 tykwon kernel: usb 1-1.2: Product: HP Color LaserJet MFP M277n
2018-02-12T17:08:24.309428+09:00 tykwon kernel: usb 1-1.2: Manufacturer: Hewlett-Packard
2018-02-12T17:08:24.318314+09:00 tykwon kernel: usb 1-1.2: SerialNumber: VNBKK97643
2018-02-12T17:08:24.340967+09:00 tykwon root: loading HP Device 001 004
2018-02-12T17:08:25.537224+09:00 tykwon python: io/hpmud/musb.c 2185: [307] hpmud_make_usb_uri() bus=001 dev=004
2018-02-12T17:08:25.540188+09:00 tykwon python: io/hpmud/musb.c 2282: hpmud_make_usb_uri() uri=hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643 bytes_read=53
2018-02-12T17:08:26.510021+09:00 tykwon kernel: usblp 1-1.2:1.1: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x03F0 pid 0x3B2A
2018-02-12T17:08:26.518337+09:00 tykwon kernel: usbcore: registered new interface driver usblp
2018-02-12T17:08:26.523457+09:00 tykwon systemd[1]: Created slice system-configure\x2dprinter.slice.
2018-02-12T17:08:26.525835+09:00 tykwon systemd[1]: Started Configure Plugged-In Printer.
2018-02-12T17:08:26.527132+09:00 tykwon systemd[1]: Reached target Printer.
2018-02-12T17:08:26.546282+09:00 tykwon udev-configure-printer: add usb-001-004
2018-02-12T17:08:26.688365+09:00 tykwon udev-configure-printer: device devpath is /devices/lm1/usb1/1-1/1-1.2
2018-02-12T17:08:26.700706+09:00 tykwon udev-configure-printer: MFG:Hewlett-Packard MDL:HP Color LaserJet MFP M277n SERN:- serial:VNBKK97643
2018-02-12T17:08:31.788344+09:00 tykwon kernel: usblp0: removed
2018-02-12T17:08:31.798343+09:00 tykwon kernel: usblp 1-1.2:1.1: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x03F0 pid 0x3B2A
2018-02-12T17:08:31.870363+09:00 tykwon udev-configure-printer: URI contains USB serial number
2018-02-12T17:08:31.871482+09:00 tykwon udev-configure-printer: URI match: usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1
2018-02-12T17:08:31.872536+09:00 tykwon udev-configure-printer: SERN field matches USB serial number
2018-02-12T17:08:31.873629+09:00 tykwon udev-configure-printer: URI match: hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643
2018-02-12T17:08:31.874594+09:00 tykwon udev-configure-printer: URI of detected printer: usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1, normalized: color laserjet mfp m277n serial vnbkk97643 interface 1
2018-02-12T17:08:31.875782+09:00 tykwon udev-configure-printer: URI of print queue: hp:/usb/HP_LaserJet_Professional_P1106?serial=000000000QN926Y1PR1a, normalized: laserjet professional p1106 serial 000000000qn926y1pr1a
2018-02-12T17:08:31.876985+09:00 tykwon udev-configure-printer: URI of detected printer: hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643, normalized: color laserjet mfp m277n serial vnbkk97643
2018-02-12T17:08:31.878166+09:00 tykwon udev-configure-printer: About to add queue for hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643
2018-02-12T17:08:34.760340+09:00 tykwon udev-add-printer: add_queue: URIs=['hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643', 'usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1']
2018-02-12T17:08:34.766174+09:00 tykwon udev-add-printer: D-Bus method call failed: org.freedesktop.DBus.Error.ServiceUnknown: The name com.redhat.NewPrinterNotification was not provided by any .service files
2018-02-12T17:08:41.722389+09:00 tykwon udev-add-printer: PPD: hplip:1/hp-color_laserjet_pro_mfp_m277-ps.ppd; Status: 0
2018-02-12T17:08:45.763635+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 232, in <module>#012 add_queue (sys.argv[1], sys.argv[2:])
2018-02-12T17:08:45.764840+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 169, in add_queue#012 installer)
2018-02-12T17:08:45.765979+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 75, in create_queue#012 (pkgs, exes) = cupshelpers.missingPackagesAndExecutables (ppd)
2018-02-12T17:08:45.767236+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/site-packages/cupshelpers/cupshelpers.py", line 889, in missingPackagesAndExecutables#012 executables = missingExecutables(ppd)
2018-02-12T17:08:45.768527+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/site-packages/cupshelpers/cupshelpers.py", line 864, in missingExecutables#012 for line in f:
2018-02-12T17:08:45.769834+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode#012 return codecs.ascii_decode(input, self.errors)[0]
2018-02-12T17:08:45.771056+09:00 tykwon udev-add-printer: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4175: ordinal not in range(128)
root@tykwon:~#
---
cupshelpers/cupshelpers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cupshelpers/cupshelpers.py b/cupshelpers/cupshelpers.py
index 978ab801..8fe7ead4 100755
--- a/cupshelpers/cupshelpers.py
+++ b/cupshelpers/cupshelpers.py
@@ -859,7 +859,7 @@ def missingExecutables(ppd):
os.unlink (tmpfname)
ppd.writeFd (tmpfd)
os.lseek (tmpfd, 0, os.SEEK_SET)
- f = os.fdopen (tmpfd, "rt")
+ f = os.fdopen (tmpfd, "rt", encoding="utf-8")
search = "*cupsFilter:"
for line in f:
if line.startswith (search):
--
2.17.2