mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +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
|
|
@ -11,7 +11,7 @@ from pre_commit import xargs
|
|||
def sys_win32_mock(mocker):
|
||||
return mocker.Mock(
|
||||
platform='win32',
|
||||
getdefaultencoding=mocker.Mock(return_value='utf-8'),
|
||||
getfilesystemencoding=mocker.Mock(return_value='utf-8'),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ def sys_win32_mock(mocker):
|
|||
def sys_linux_mock(mocker):
|
||||
return mocker.Mock(
|
||||
platform='linux',
|
||||
getdefaultencoding=mocker.Mock(return_value='utf-8'),
|
||||
getfilesystemencoding=mocker.Mock(return_value='utf-8'),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue