Bump version and resolve a console encoding error. (#1149)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>
|
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = "0.1.0a5"
|
__version__ = "0.1.0a6"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
import codecs
|
import codecs
|
||||||
|
import locale
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
from importlib.metadata import entry_points
|
from importlib.metadata import entry_points
|
||||||
from .__about__ import __version__
|
from .__about__ import __version__
|
||||||
@@ -204,9 +205,14 @@ def _handle_output(args, result: DocumentConverterResult):
|
|||||||
"""Handle output to stdout or file"""
|
"""Handle output to stdout or file"""
|
||||||
if args.output:
|
if args.output:
|
||||||
with open(args.output, "w", encoding="utf-8") as f:
|
with open(args.output, "w", encoding="utf-8") as f:
|
||||||
f.write(result.text_content)
|
f.write(result.markdown)
|
||||||
else:
|
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):
|
def _exit_with_error(message: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user