First time here? Check out the FAQ!

AtributeError when importing users from SE dump

I tryed the import multiple times and always get the error in the same point:

Traceback (most recent call last):
File "", line 11, in <module>
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 459, in execute_manager
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 382, in execute
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 196, in run_from_argv
  self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 232, in execute
  output = self.handle(*args, **options)
File "/var/www/askbot-devel/askbot/utils/", line 19, in wrapper
  return func(*args, **kwargs)
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/", line 374, in handle
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/", line 916, in transfer_users
  u_type =
AttributeError: 'NoneType' object has no attribute 'name'

Is it an error in the import script or maybe the dump has an error somewhere?

mornaner's avatar
asked 2012-11-20 03:56:13 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


This one is not that hard to plug, but I'd like to know more about the contents of se_u. It is strange that user_type is None. It's possible that this user account is unusual in some way.

Seems to be a data-related issue that was not seen before in other dumps that we have used.

There is something that can save you time: the importer script has two options that allow you to separately read the dump and process the data. Use --help option to find out more.

Also - you can save yourself some time by using sqlite3 database engine for your test imports, as the database file can be simply copied to save the data and avoid re-reading it.

Evgeny's avatar
answered 2012-11-20 09:19:35 -0500
edit flag offensive 0 remove flag delete link


I removed the last users to check if this was a problem of the data dump but it raises the same error again. I think it's in the last user, because the first times was on 99.91% and now that I removed some users it's on 99.64%

mornaner's avatar mornaner (2012-11-20 15:33:53 -0500) edit

You can fix up the code in that vicinity. if se_u.user_type is None: ... do something special .... If I had the dump here, I could work with this, but would have to bill you for this work.

Evgeny's avatar Evgeny (2012-11-20 15:38:09 -0500) edit
add a comment see more comments