[GH-ISSUE #25] locale.getdefaultlocale error #18

Closed
opened 2026-02-27 16:00:42 +03:00 by kerem · 6 comments
Owner

Originally created by @jonjo on GitHub (Feb 27, 2013).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/25

./manage.py syncdb

Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table virtmgr_host
Creating table virtmgr_vm

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
File "./manage.py", line 14, in
execute_manager(settings)
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, _options)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(
_options)
File "/usr/lib64/python2.7/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/lib64/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/lib64/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, *_named)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/init.py", line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 150, in call_command
return klass.execute(_args, *_defaults)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/init.py", line 105, in get_default_username
default_username = get_system_username()
File "/usr/lib64/python2.7/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

Originally created by @jonjo on GitHub (Feb 27, 2013). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/25 # ./manage.py syncdb Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table django_content_type Creating table django_session Creating table django_site Creating table django_admin_log Creating table virtmgr_host Creating table virtmgr_vm You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): yes Traceback (most recent call last): File "./manage.py", line 14, in <module> execute_manager(settings) File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 459, in execute_manager utility.execute() File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(_args, *_options.**dict**) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(_args, *_options) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 371, in handle return self.handle_noargs(*_options) File "/usr/lib64/python2.7/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs emit_post_sync_signal(created_models, verbosity, interactive, db) File "/usr/lib64/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal interactive=interactive, db=db) File "/usr/lib64/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, *_named) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/**init**.py", line 73, in create_superuser call_command("createsuperuser", interactive=True, database=db) File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 150, in call_command return klass.execute(_args, *_defaults) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(_args, *_options) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle default_username = get_default_username() File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/**init**.py", line 105, in get_default_username default_username = get_system_username() File "/usr/lib64/python2.7/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
kerem closed this issue 2026-02-27 16:00:42 +03:00
Author
Owner

@retspen commented on GitHub (Feb 27, 2013):

$ rm webvirtmgr.db
$ export LC_ALL=C
$ export LANG=C
$ ./manage.py syncdb

<!-- gh-comment-id:14183204 --> @retspen commented on GitHub (Feb 27, 2013): $ rm webvirtmgr.db $ export LC_ALL=C $ export LANG=C $ ./manage.py syncdb
Author
Owner

@jonjo commented on GitHub (Feb 27, 2013):

vesta webvirtmgr # rm webvirtmgr.db
vesta webvirtmgr # export LC_ALL=C
vesta webvirtmgr # export LANG=C
vesta webvirtmgr # ./manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table virtmgr_host
Creating table virtmgr_vm

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
File "./manage.py", line 14, in
execute_manager(settings)
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, _options)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(
_options)
File "/usr/lib64/python2.7/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/lib64/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/lib64/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, *_named)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/init.py", line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
File "/usr/lib64/python2.7/site-packages/django/core/management/init.py", line 150, in call_command
return klass.execute(_args, *_defaults)
File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/init.py", line 105, in get_default_username
default_username = get_system_username()
File "/usr/lib64/python2.7/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

<!-- gh-comment-id:14183311 --> @jonjo commented on GitHub (Feb 27, 2013): vesta webvirtmgr # rm webvirtmgr.db vesta webvirtmgr # export LC_ALL=C vesta webvirtmgr # export LANG=C vesta webvirtmgr # ./manage.py syncdb Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table django_content_type Creating table django_session Creating table django_site Creating table django_admin_log Creating table virtmgr_host Creating table virtmgr_vm You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): yes Traceback (most recent call last): File "./manage.py", line 14, in <module> execute_manager(settings) File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 459, in execute_manager utility.execute() File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(_args, *_options.**dict**) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(_args, *_options) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 371, in handle return self.handle_noargs(*_options) File "/usr/lib64/python2.7/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs emit_post_sync_signal(created_models, verbosity, interactive, db) File "/usr/lib64/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal interactive=interactive, db=db) File "/usr/lib64/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, *_named) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/**init**.py", line 73, in create_superuser call_command("createsuperuser", interactive=True, database=db) File "/usr/lib64/python2.7/site-packages/django/core/management/**init**.py", line 150, in call_command return klass.execute(_args, *_defaults) File "/usr/lib64/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(_args, *_options) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle default_username = get_default_username() File "/usr/lib64/python2.7/site-packages/django/contrib/auth/management/**init**.py", line 105, in get_default_username default_username = get_system_username() File "/usr/lib64/python2.7/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
Author
Owner

@jonjo commented on GitHub (Feb 27, 2013):

downgraded to dev-python/django-1.3.7 and it worked

<!-- gh-comment-id:14184159 --> @jonjo commented on GitHub (Feb 27, 2013): downgraded to dev-python/django-1.3.7 and it worked
Author
Owner

@retspen commented on GitHub (Feb 27, 2013):

Django-1.4.x - ?

<!-- gh-comment-id:14184221 --> @retspen commented on GitHub (Feb 27, 2013): Django-1.4.x - ?
Author
Owner

@jonjo commented on GitHub (Feb 27, 2013):

was not working on 1.4.5

<!-- gh-comment-id:14184350 --> @jonjo commented on GitHub (Feb 27, 2013): was not working on 1.4.5
Author
Owner

@retspen commented on GitHub (Feb 27, 2013):

not tested on Django-1.4.5 but on Django-1.4.2 - work fine

<!-- gh-comment-id:14184851 --> @retspen commented on GitHub (Feb 27, 2013): not tested on Django-1.4.5 but on Django-1.4.2 - work fine
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#18
No description provided.