root@box:/mnt/raid1/seafile/seafile-server-7.0.4# ./reset-admin.sh
E-mail address: ***
Password:
Password (again):
Traceback (most recent call last):
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/seahub/base/management/commands/createsuperuser.py", line 150, in handle
User.objects.create_superuser(email, password)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/seahub/base/accounts.py", line 71, in create_superuser
u = self.create_user(email, password, is_staff=True, is_active=True)
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/seahub/base/accounts.py", line 59, in create_user
user.save()
File "/mnt/raid1/seafile/seafile-server-7.0.4/seahub/seahub/base/accounts.py", line 329, in save
if emailuser:
File "/usr/local/lib/python2.7/dist-packages/future/types/newobject.py", line 70, in __nonzero__
return type(self).__bool__(self)
AttributeError: type object '_SearpcObj' has no attribute '__bool__'
I think this is a python2.7/python3 bug in libsearpc and getattr method should not return None for bool or other XXX methods.
def __nonzero__(self):
try:
# if hasattr(self, '__bool__'):
if getattr(self, '__bool__', None) is not None:
return type(self).__bool__(self)
# if hasattr(self, '__len__'):
if getattr(self, '__len__', None) is not None:
return type(self).__len__(self)
except:
return True
# object has no __nonzero__ method
return True
Can you check your PYTHON version? printenv PYTHON or echo $PYTHON $ python -V
Ok. I can try this later but i don’t think this fix the error, because code the same.
github .com/PythonCharmers/python-future/blob/dd4f27ec99eec1ef9049f93db1176da0ea0d2e84/src/future/types/newobject.py#L86