search for: non_utf8_fname

Displaying 3 results from an estimated 3 matches for "non_utf8_fname".

2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...875226..0bb1ac1d0 100644 --- a/python/t/test830RHBZ1406906.py +++ b/python/t/test830RHBZ1406906.py @@ -55,3 +55,9 @@ class Test830RHBZ1406906(unittest.TestCase): elif sys.version_info >= (2, 0): self.assertTrue( any(path for path in g.find("/") if non_utf8_fname in path)) + + # change decoding error handler + self.assertEqual( + guestfs.set_decode_error_handler("surrogateescape"), 'strict') + self.assertTrue( + any(path for path in g.find("/") if non_utf8_fname in path)) -- 2.11.0
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...part_disk("/dev/sda", "mbr") + g.mkfs("ext4", "/dev/sda1") + g.mount("/dev/sda1", "/") + + self.assertEqual(g.find("/"), ['lost+found']) + + # touch file with illegal unicode character + non_utf8_fname = "\udcd4" + open(os.path.join(self.tempdir, non_utf8_fname), "w").close() + + g.copy_in(self.tempdir, "/") + + if sys.version_info >= (3, 0): + with self.assertRaises(UnicodeDecodeError): + g.find("/") # seg...
2017 May 21
3
[PATCH 0/2] python: improved UTF8 decoding error handling
The Python 3 bindings currently are unable to deal with non UTF8 characters. This series continues what proposed in RHBZ#1406906. A new function 'set_decode_error_handler' allows the User to specify how to deal with decoding errors. The default behaviour will be raising a UnicodeDecodeError. If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped in a