id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 7423 syncdb fails to read in password in eclipse when creating database galaxy4sale@… AeroNotix "(Version 0.97pre) When I run manage.py syncdb to create a new database within eclipse, it fails when it tries to read in a password. Here is the output: {{{ Creating table auth_message Creating table auth_group Creating table auth_user Creating table auth_permission Creating table django_content_type Creating table django_session Creating table django_site Creating table lostitems_lostitem Creating table django_admin_log Creating table registration_registrationprofile 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 Username (Leave blank to use 'foo'): admin E-mail address: foo@bar.baz Traceback (most recent call last): File ""/workspace/laf/laf/manage.py"", line 11, in execute_manager(settings) File ""/workspace/laf/django/core/management/__init__.py"", line 272, in execute_manager utility.execute() File ""/workspace/laf/django/core/management/__init__.py"", line 219, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File ""/workspace/laf/django/core/management/base.py"", line 72, in run_from_argv self.execute(*args, **options.__dict__) File ""/workspace/laf/django/core/management/base.py"", line 86, in execute output = self.handle(*args, **options) File ""/workspace/laf/django/core/management/base.py"", line 168, in handle return self.handle_noargs(**options) File ""/workspace/laf/django/core/management/commands/syncdb.py"", line 97, in handle_noargs emit_post_sync_signal(created_models, verbosity, interactive) File ""//workspace/laf/django/core/management/sql.py"", line 491, in emit_post_sync_signal verbosity=verbosity, interactive=interactive) File ""/workspace/laf/django/dispatch/dispatcher.py"", line 360, in send **named File ""/workspace/laf/django/dispatch/robustapply.py"", line 47, in robustApply return receiver(*arguments, **named) File ""/workspace/laf/django/contrib/auth/management.py"", line 45, in create_superuser do_create() File ""/workspace/laf/django/contrib/auth/create_superuser.py"", line 73, in createsuperuser password = getpass.getpass() File ""/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/getpass.py"", line 32, in unix_getpass old = termios.tcgetattr(fd) # a copy to save termios.error: (25, 'Inappropriate ioctl for device') }}} After I researched this problem, i found that it is because the input stream is not tty in eclipse, which the getpass() call is expecting. An easy workaround is to just read from stdin if it is not a tty stream. This will look something like: {{{ if os.isatty(sys.stdin.fileno()): p = getpass.getpass('') else: print 'Password: ' p = sys.stdin.readline().rstrip() }}} However, this will cause the password to be echoed as the user is typing it in. The patch is fairly quick, and I can provide one if this is the way you want to go. " New feature closed Core (Management commands) dev Normal fixed post10 Accepted 1 0 0 0 0 0