I am a newbie here. I tried to setup my first Django project. When
running command "syncdb", the command got an EOFError exception from
raw_input() in contrib/auth/management.py, where it was trying to ask
me if I want to create a superuser.

Having checking and 'truss', I found the reason should be that the
STDIN was in NONBLOCK mode. I modified the source to workaround this
to let me go on (just modify the flags of STDIN).

It seems that no one had encounter such situation. So It must be
something weird in my system/configuration:
FreeBSD 4.11
Postgresql 8.2.3 (built from source)
Python 2.5 (built from source)
pyscopg2 2.05 (built from source)

Hope someone give me a graceful fix of this problem. Thanks.

Here is the diff:

Index: management.py
===================================================================
--- management.py       (revision 4596)
+++ management.py       (working copy)
@@ -36,6 +36,11 @@
     if User in created_models and kwargs.get('interactive', True):
         msg = "\nYou just installed Django's auth system, which means
you don't
 have " \
                 "any superusers defined.\nWould you like to create
one now? (ye
s/no): "
+       import sys
+       import os
+       import fcntl
+       save_fl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL)
+       fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL,
save_fl&~os.O_NONBLOCK)
         confirm = raw_input(msg)
         while 1:
             if confirm not in ('yes', 'no'):
@@ -44,6 +49,7 @@
             if confirm == 'yes':
                 do_create()
             break
+       fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, save_fl)

 dispatcher.connect(create_permissions, signal=signals.post_syncdb)
 dispatcher.connect(create_superuser, sender=auth_app,
signal=signals.post_syncdb)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to