Skip to content

Commit efc55b2

Browse files
authored
Bump version and resolve a console encoding error. (#1149)
1 parent 52432bd commit efc55b2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2024-present Adam Fourney <[email protected]>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "0.1.0a5"
4+
__version__ = "0.1.0a6"

packages/markitdown/src/markitdown/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import argparse
55
import sys
66
import codecs
7+
import locale
78
from textwrap import dedent
89
from importlib.metadata import entry_points
910
from .__about__ import __version__
@@ -204,9 +205,14 @@ def _handle_output(args, result: DocumentConverterResult):
204205
"""Handle output to stdout or file"""
205206
if args.output:
206207
with open(args.output, "w", encoding="utf-8") as f:
207-
f.write(result.text_content)
208+
f.write(result.markdown)
208209
else:
209-
print(result.text_content)
210+
# Handle stdout encoding errors more gracefully
211+
print(
212+
result.markdown.encode(sys.stdout.encoding, errors="replace").decode(
213+
sys.stdout.encoding
214+
)
215+
)
210216

211217

212218
def _exit_with_error(message: str):

0 commit comments

Comments
 (0)