File: 0026-Fix-handling-of-unicode-filenames-in-sixext.py.patch

package info (click to toggle)
hplip 3.22.10%2Bdfsg0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 171,296 kB
  • sloc: python: 83,373; ansic: 71,016; cpp: 65,202; sh: 4,408; perl: 4,397; makefile: 937
file content (28 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Gaurav Sood <gaurav-sood@invalid-email.launchpad.net>
Date: Thu, 4 May 2017 18:32:08 +0200
Subject: Fix handling of unicode filenames in sixext.py

LP: #1480152
Closes: #861731
---
 base/sixext.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/base/sixext.py b/base/sixext.py
index 0bf4fc4..311bf72 100644
--- a/base/sixext.py
+++ b/base/sixext.py
@@ -110,11 +110,11 @@ if PY3:
 
 
     def to_string_utf8(s):
-        return s.decode("utf-8")
+        return s.decode("utf-8", 'ignore')
 
 
     def to_string_latin(s):
-        return s.decode("latin-1")
+        return s.decode("latin-1", 'ignore')
 
 
     def to_unicode(s, enc=None):