Fix to bytes surrogate and nonencodable chars (#21180)

* Add a surrogate_then_replace error strategy to keep to_bytes from tracebacking by default
* Port all code that explicitly used surrogate_or_replace to surrogate_then_replace
This commit is contained in:
Toshio Kuratomi 2017-02-09 17:13:40 -08:00 committed by GitHub
commit 98541b7c8b
5 changed files with 94 additions and 39 deletions

View file

@ -818,7 +818,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
data['rc'] = res['rc']
return data
def _low_level_execute_command(self, cmd, sudoable=True, in_data=None, executable=None, encoding_errors='surrogate_or_replace'):
def _low_level_execute_command(self, cmd, sudoable=True, in_data=None, executable=None, encoding_errors='surrogate_then_replace'):
'''
This is the function which executes the low level shell command, which
may be commands to create/remove directories for temporary files, or to