mirror of
https://github.com/microsoft/markitdown.git
synced 2025-06-26 22:00:21 +00:00
Bump version and resolve a console encoding error. (#1149)
This commit is contained in:
parent
52432bd228
commit
efc55b260d
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = "0.1.0a5"
|
||||
__version__ = "0.1.0a6"
|
||||
|
@ -4,6 +4,7 @@
|
||||
import argparse
|
||||
import sys
|
||||
import codecs
|
||||
import locale
|
||||
from textwrap import dedent
|
||||
from importlib.metadata import entry_points
|
||||
from .__about__ import __version__
|
||||
@ -204,9 +205,14 @@ def _handle_output(args, result: DocumentConverterResult):
|
||||
"""Handle output to stdout or file"""
|
||||
if args.output:
|
||||
with open(args.output, "w", encoding="utf-8") as f:
|
||||
f.write(result.text_content)
|
||||
f.write(result.markdown)
|
||||
else:
|
||||
print(result.text_content)
|
||||
# Handle stdout encoding errors more gracefully
|
||||
print(
|
||||
result.markdown.encode(sys.stdout.encoding, errors="replace").decode(
|
||||
sys.stdout.encoding
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def _exit_with_error(message: str):
|
||||
|
Loading…
x
Reference in New Issue
Block a user