Skip to content

Commit

Permalink
no print
Browse files Browse the repository at this point in the history
  • Loading branch information
HaiyiMei committed Jan 23, 2024
1 parent ac18fc9 commit 3d05f32
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions xrfeitoria/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ def setup_encoding(
# Set an errorhandler except for "strict"
if handler in ('ignore', 'replace', 'backslashreplace', 'xmlcharrefreplace'):
errorhandler = handler
elif handler in ('', 'strict'):
print(
f'PYTHONIOENCODING is going to use "strict" errorhandler, which could raise errors during logging. Reset to "{errorhandler}"',
file=sys.stderr,
)
else:
print(
f'PYTHONIOENCODING is set with invalid errorhandler "{handler}". Reset to "{errorhandler}"',
file=sys.stderr,
)
# elif handler in ('', 'strict'):
# print(
# f'PYTHONIOENCODING is going to use "strict" errorhandler, which could raise errors during logging. Reset to "{errorhandler}"',
# file=sys.stderr,
# )
# else:
# print(
# f'PYTHONIOENCODING is set with invalid errorhandler "{handler}". Reset to "{errorhandler}"',
# file=sys.stderr,
# )
# if not encoding.lower().startswith("utf"):
os.environ['PYTHONIOENCODING'] = f"{encoding or ''}:{errorhandler}"

Expand Down

0 comments on commit 3d05f32

Please sign in to comment.