1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Call locale.setlocale() to load locale

This commit is contained in:
Xavier Fernandez 2016-03-07 10:37:11 +01:00
parent c0798f739b
commit 5589ff286d

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
@ -209,6 +210,9 @@ def main(args=None):
sys.stderr.write(os.linesep)
sys.exit(1)
# Needed for locale.getpreferredencoding(False) to work
# in pip.utils.encoding.auto_decode
locale.setlocale(locale.LC_ALL, '')
command = commands_dict[cmd_name](isolated=check_isolated(cmd_args))
return command.main(cmd_args)