Skip to content

Commit

Permalink
specify encoding for hotkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Jul 9, 2024
1 parent 47aaad9 commit f106497
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ahk/_hotkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ def _render_hotkey_template(self) -> str:
def listener(self) -> None:
hotkey_script_contents = self._render_hotkey_template()
logging.debug('hotkey script contents:\n%s', hotkey_script_contents)
with tempfile.NamedTemporaryFile(mode='w', prefix='python-ahk-hotkeys-', suffix='.ahk', delete=False) as f:
with tempfile.NamedTemporaryFile(
mode='w', prefix='python-ahk-hotkeys-', suffix='.ahk', delete=False, encoding='utf-8'
) as f:
f.write(hotkey_script_contents)
atexit.register(try_remove, f.name)
self._proc = subprocess.Popen(
Expand Down

0 comments on commit f106497

Please sign in to comment.