Fix xargs.partition: use sys.getfilesystemencoding

The previous `sys.getdefaultencoding` almost always fallsback to
`ascii` while `sys.getfilesystemencoding` is utf-8 once in utf-8 mode.
This commit is contained in:
George Y. Kussumoto 2018-10-05 16:39:49 -03:00
parent df5d171cd7
commit 2ad69e12ce
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ def _get_command_length(command, arg):
if sys.platform == 'win32':
return len(full_cmd)
return len(full_cmd.encode(sys.getdefaultencoding()))
return len(full_cmd.encode(sys.getfilesystemencoding()))
class ArgumentTooLongError(RuntimeError):