mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
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:
parent
df5d171cd7
commit
2ad69e12ce
2 changed files with 3 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue