疑問に思う
ターミナルで LANG=en_US.UTF-8 、 LC_ALL=en_US.UTF-8 のセットを変更しましたが、ターミナルから実行 python manage.py createsuperuser を生成すると、動作しますが、ECLIPSE IDE からは動作しないのはなぜですか?
コード
import locale
print locale.getdefaultlocale()
出力
(None, None)
Eclipse から createsuperuser を実行するとエラーが発生する
Traceback (most recent call last):
File "/Users/Abhimanyu/Documents/workspace/new1/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 105, in get_default_username
default_username = get_system_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None