mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
FIXUP: Moar CI fixes
This commit is contained in:
parent
66af7bce59
commit
17bed1a724
5 changed files with 11 additions and 4 deletions
|
@ -123,6 +123,10 @@ class Document:
|
|||
self.validate_output_filename(filename)
|
||||
self._output_filename = filename
|
||||
|
||||
@property
|
||||
def sanitized_output_filename(self) -> None:
|
||||
return util.replace_control_chars(self.output_filename)
|
||||
|
||||
@property
|
||||
def suffix(self) -> str:
|
||||
return self._suffix
|
||||
|
|
|
@ -216,7 +216,10 @@ class IsolationProvider(ABC):
|
|||
# Ensure nothing else is read after all bitmaps are obtained
|
||||
p.stdout.close()
|
||||
|
||||
safe_doc.save(document.output_filename)
|
||||
# Saving it with a different name first, because PyMuPDF cannot handle
|
||||
# non-Unicode chars.
|
||||
safe_doc.save(document.sanitized_output_filename)
|
||||
os.replace(document.sanitized_output_filename, document.output_filename)
|
||||
|
||||
# TODO handle leftover code input
|
||||
text = "Converted document"
|
||||
|
|
2
poetry.lock
generated
2
poetry.lock
generated
|
@ -1046,4 +1046,4 @@ type = ["pytest-mypy"]
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.9,<3.13"
|
||||
content-hash = "93097a7d09c23ca12dbedd440965381fdd12dca2a8b1a0defe0f75b0e4e2092a"
|
||||
content-hash = "9b4083a41b94d03d7688fb6fcc82a0af9839f4dfc769204548c44bf35bcda60b"
|
||||
|
|
|
@ -17,7 +17,7 @@ python = ">=3.9,<3.13"
|
|||
click = "*"
|
||||
appdirs = "*"
|
||||
PySide6 = "^6.7.1"
|
||||
PyMuPDF = "^1.23.8"
|
||||
PyMuPDF = "^1.23.3" # The version in Fedora 39
|
||||
colorama = "*"
|
||||
pyxdg = {version = "*", platform = "linux"}
|
||||
requests = "*"
|
||||
|
|
|
@ -79,7 +79,7 @@ class TestQubes(IsolationProviderTest):
|
|||
)
|
||||
with pytest.raises(errors.ConverterProcException):
|
||||
doc = Document(sample_doc)
|
||||
provider.doc_to_pixels(doc, tmpdir, proc)
|
||||
provider._convert(doc, tmpdir, None, proc)
|
||||
assert provider.get_proc_exception(proc) == errors.QubesQrexecFailed
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue