This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tanbro-liu
Recipients tanbro-liu
Date 2015-05-28.02:20:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
On windows8.1 x64, current user name contains non-ascii characters. When executing ``pip`` in the command-line, such an error happens::

	Traceback (most recent call last):
	  File "C:\Python27\lib\", line 162, in _run_module_as_main
		"__main__", fname, loader, pkg_name)
	  File "C:\Python27\lib\", line 72, in _run_code
		exec code in run_globals
	  File "C:\Python27\Scripts\pip.exe\", line 9, in <module>
	  File "C:\Python27\lib\site-packages\pip\", line 210, in main
		cmd_name, cmd_args = parseopts(args)
	  File "C:\Python27\lib\site-packages\pip\", line 165, in parseopts
	  File "C:\Python27\lib\", line 1676, in print_help
		file.write(self.format_help().encode(encoding, "replace"))
	  File "C:\Python27\lib\", line 1656, in format_help
	  File "C:\Python27\lib\", line 1639, in format_option_help
	  File "C:\Python27\lib\", line 1120, in format_help
		result += OptionContainer.format_help(self, formatter)
	  File "C:\Python27\lib\", line 1091, in format_help
	  File "C:\Python27\lib\", line 1080, in format_option_help
	  File "C:\Python27\lib\", line 322, in format_option
		help_text = self.expand_default(option)
	  File "C:\Python27\lib\site-packages\pip\", line 110, in expand_de
		return optparse.IndentedHelpFormatter.expand_default(self, option)
	  File "C:\Python27\lib\", line 288, in expand_default
		return, str(default_value))
	UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-10: ordi
	nal not in range(128)

i think, we can modify /lib/ line 288 to avoid such an error in windows::

  -- return, str(default_value))
  ++ return
  ++     self.default_tag,
  ++     default_value.encode(sys.getfilesystemencoding())
  ++     if isinstance(default_value, uicnode)
  ++     else str(default_value)
  ++ )
Date User Action Args
2015-05-28 02:20:59tanbro-liusetrecipients: + tanbro-liu
2015-05-28 02:20:59tanbro-liusetmessageid: <>
2015-05-28 02:20:59tanbro-liulinkissue24307 messages
2015-05-28 02:20:59tanbro-liucreate