From a764c9f7e3cb6cc57b3fd5bc0b88d3e6f43a2865 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Wed, 11 Mar 2026 15:52:10 +0800 Subject: [PATCH 1/2] fix: add quotes to pip install commands in package README The install commands without quotes fail in some shells (e.g., zsh). Using quoted version 'markitdown[all]' works universally. Closes #1574 --- packages/markitdown/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/markitdown/README.md b/packages/markitdown/README.md index edd270166..e52b95cd3 100644 --- a/packages/markitdown/README.md +++ b/packages/markitdown/README.md @@ -10,7 +10,7 @@ From PyPI: ```bash -pip install markitdown[all] +pip install 'markitdown[all]' ``` From source: @@ -18,7 +18,7 @@ From source: ```bash git clone git@github.com:microsoft/markitdown.git cd markitdown -pip install -e packages/markitdown[all] +pip install -e 'packages/markitdown[all]' ``` ## Usage From 94c6053dd01d301a998662d2baf8c6a07bf04249 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 14 Mar 2026 03:24:32 +0800 Subject: [PATCH 2/2] fix: initialize res = None to prevent UnboundLocalError When converter.accepts() returns False, the res variable is never assigned, causing UnboundLocalError when checking 'if res is not None'. This fix initializes res = None before the conversion attempt. --- packages/markitdown/src/markitdown/_markitdown.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/markitdown/src/markitdown/_markitdown.py b/packages/markitdown/src/markitdown/_markitdown.py index f342a614b..2ca63ef72 100644 --- a/packages/markitdown/src/markitdown/_markitdown.py +++ b/packages/markitdown/src/markitdown/_markitdown.py @@ -601,6 +601,7 @@ def _convert( ), f"{type(converter).__name__}.accept() should NOT change the file_stream position" # Attempt the conversion + res = None if _accepts: try: res = converter.convert(file_stream, stream_info, **_kwargs)