Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 572665689
  • Loading branch information
craigcitro authored and colaboratory-team committed Oct 11, 2023
1 parent be4b66f commit aeac997
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions google/colab/_system_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,12 @@ def _configure_term_settings(pty_fd):

def _run_command(cmd, clear_streamed_output):
"""Calls the shell command, forwarding input received on the stdin_socket."""
locale_encoding = locale.getpreferredencoding()
if locale_encoding != _ENCODING:
raise NotImplementedError(
'A UTF-8 locale is required. Got {}'.format(locale_encoding)
)
if not sys.flags.utf8_mode:
locale_encoding = locale.getpreferredencoding()
if locale_encoding != _ENCODING:
raise NotImplementedError(
'A UTF-8 locale is required. Got {}'.format(locale_encoding)
)

parent_pty, child_pty = pty.openpty()
_configure_term_settings(child_pty)
Expand Down

0 comments on commit aeac997

Please sign in to comment.