Skip to content

Commit e543390

Browse files
committed
fix: resolve macOS FileNotFoundError and stabilize API error handling
1 parent 14902a6 commit e543390

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lexoid/core/conversion_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,16 @@ def handle_load_finished(status):
159159

160160

161161
def convert_doc_to_pdf(input_path: str, temp_dir: str) -> str:
162+
input_path = os.path.abspath(input_path)
163+
temp_dir = os.path.abspath(temp_dir)
162164
temp_path = os.path.join(
163165
temp_dir, os.path.splitext(os.path.basename(input_path))[0] + ".pdf"
164166
)
165167

166168
# Convert the document to PDF
167169
# docx2pdf is not supported in linux. Use LibreOffice in linux instead.
168170
# May need to install LibreOffice if not already installed.
169-
input_path = os.path.abspath(input_path)
170-
temp_dir = os.path.abspath(temp_dir)
171+
171172
if "linux" in sys.platform.lower():
172173
subprocess.run(
173174
[

0 commit comments

Comments
 (0)