From b3e2562c00eb9f95eba58fe8aebb7c9d89416bab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 15 Jul 2018 10:38:40 +0530 Subject: [PATCH] macOS bundle: Set the PYTHONIOENCODING env var to utf-8 There are apparently still some situations where python ends up with ascii as its I/O encoding on macOS. See #724 --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a05c25396..7a8cf7ccc 100755 --- a/setup.py +++ b/setup.py @@ -658,7 +658,9 @@ def src_ignore(parent, entries): NSHighResolutionCapable=True, NSSupportsAutomaticGraphicsSwitching=True, LSApplicationCategoryType='public.app-category.utilities', - LSEnvironment={'KITTY_LAUNCHED_BY_LAUNCH_SERVICES': '1'}, + # Ensure I/O encoding is always utf-8, see + # https://github.com/kovidgoyal/kitty/issues/724 + LSEnvironment={'KITTY_LAUNCHED_BY_LAUNCH_SERVICES': '1', 'PYTHONIOENCODING': 'utf-8'}, ) plistlib.writePlist(pl, 'Info.plist') os.rename('../share', 'Resources')