dangerzone/tests
Naglis Jonaitis d632908a44
Fix printing of filenames with surrogate escapes
On Unix systems a filename can be a sequence of bytes that is not valid
UTF-8. Python uses[1] surrogate escapes to allow to decode such
filenames to Unicode (bytes that cannot be decoded are replaced by a
surrogate; upon encoding the surrogate is converted to the original
byte).

From `click` docs[2]:

> Invalid bytes or surrogate escapes will raise an error when written
> to a stream with `errors="strict"`. This will typically happen with
> `stdout` when the locale is something like `en_GB.UTF-8`.

To fix that, we use `utils.replace_control_chars()` before printing the
filenames to `stdout` so that surrogate escapes are replaced by �.

Fixes #768
2024-04-25 14:11:25 +03:00
..
gui Create tests/test_settings.py with extra coverage 2024-04-01 18:18:41 +03:00
isolation_provider tests: Add termination tests for Dummy provider 2024-04-24 15:06:01 +03:00
test_docs Adds file formats: epub svg bmp pnm bpm ppm 2024-01-31 19:58:48 +00:00
test_docs_compressed Add page limit of 10000 2023-09-28 11:01:14 +01:00
test_docs_external Add test files for hwp/hwpx (base64 encoded) 2023-08-01 14:37:14 +01:00
test_docs_large@0068ffcb67 Replace armor guards that indicate isolated output 2023-08-22 16:11:41 +01:00
__init__.py Relax the restrictions of util.replace_control_chars 2024-04-25 14:11:16 +03:00
conftest.py tests: Test our own custom QApplication 2023-07-28 12:18:58 +03:00
test_cli.py Fix printing of filenames with surrogate escapes 2024-04-25 14:11:25 +03:00
test_document.py remove number from test_doc2 variable 2023-07-25 15:00:31 +01:00
test_large_set.py Adapt code so it works for reporting script 2023-08-22 16:11:36 +01:00
test_ocr.py Remove timeouts 2024-02-06 20:11:43 +00:00
test_settings.py Create tests/test_settings.py with extra coverage 2024-04-01 18:18:41 +03:00
test_util.py Revert "Add non-blocking read utility" 2024-02-06 19:42:41 +00:00