diff --git a/dangerzone/conversion/common.py b/dangerzone/conversion/common.py index 5b75186..2112206 100644 --- a/dangerzone/conversion/common.py +++ b/dangerzone/conversion/common.py @@ -84,8 +84,8 @@ class DangerzoneConverter: args: List[str], *, error_message: str, - timeout_message: str, - timeout: Optional[float], + timeout_message: Optional[str] = None, + timeout: Optional[float] = None, stdout_callback: Optional[Callable] = None, stderr_callback: Optional[Callable] = None, ) -> Tuple[bytes, bytes]: diff --git a/dangerzone/conversion/doc_to_pixels.py b/dangerzone/conversion/doc_to_pixels.py index 60157d7..9c38212 100644 --- a/dangerzone/conversion/doc_to_pixels.py +++ b/dangerzone/conversion/doc_to_pixels.py @@ -171,14 +171,6 @@ class DocumentToPixels(DangerzoneConverter): if file_type == hwpx_file_type: mime_type = "application/x-hwp+zip" - # Get file size (in MiB) - size = os.path.getsize("/tmp/input_file") / 1024**2 - - # Calculate timeout for the first few file operations. The difference with the - # subsequent ones is that we don't know the number of pages, before we have a - # PDF at hand, so we rely on size heuristics. - timeout = self.calculate_timeout(size) - # Convert input document to PDF conversion = conversions[mime_type] if conversion["type"] is None: @@ -207,11 +199,6 @@ class DocumentToPixels(DangerzoneConverter): await self.run_command( args, error_message="Conversion to PDF with LibreOffice failed", - timeout_message=( - "Error converting document to PDF, LibreOffice timed out after" - f" {timeout} seconds" - ), - timeout=timeout, ) pdf_filename = "/tmp/input_file.pdf" # XXX: Sometimes, LibreOffice can fail with status code 0. So, we need to @@ -278,8 +265,6 @@ class DocumentToPixels(DangerzoneConverter): await self.run_command( unzip_args, error_message="LibreOffice extension installation failed (unzipping)", - timeout_message="unzipping LibreOffice extension timed out 5 seconds", - timeout=5, ) def detect_mime_type(self, path: str) -> str: