﻿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
26409	Python 2.7.11 causes manage.py ValueError	György Kiss	nobody	"Python 2.7.11 causes this exception when running `manage.py` or `django-admin.py:`

{{{
Traceback (most recent call last):
  File ""./manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 353, in execute_from_command_line
    utility.execute()
  File ""/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 327, in execute
    django.setup()
  File ""/usr/local/lib/python2.7/site-packages/django/__init__.py"", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File ""/usr/local/lib/python2.7/site-packages/django/apps/registry.py"", line 115, in populate
    app_config.ready()
  File ""/usr/local/lib/python2.7/site-packages/django/contrib/admin/apps.py"", line 22, in ready
    self.module.autodiscover()
  File ""/usr/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py"", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File ""/usr/local/lib/python2.7/site-packages/django/utils/module_loading.py"", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File ""/usr/local/lib/python2.7/importlib/__init__.py"", line 37, in import_module
    __import__(name)
  File ""/officecontrol/src/core/admin.py"", line 45, in <module>
    class UserChangeForm(forms.ModelForm):
  File ""/usr/local/lib/python2.7/site-packages/django/forms/models.py"", line 247, in __new__
    opts.field_classes)
  File ""/usr/local/lib/python2.7/site-packages/django/forms/models.py"", line 172, in fields_for_model
    formfield = f.formfield(**kwargs)
  File ""/usr/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py"", line 1120, in formfield
    return super(CharField, self).formfield(**defaults)
  File ""/usr/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py"", line 884, in formfield
    defaults['choices'] = self.get_choices(include_blank=include_blank)
  File ""/usr/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py"", line 811, in get_choices
    for choice, __ in choices:
ValueError: too many values to unpack
}}}

I can reproduce it every time. **Earlier python versions are not affected.**
We have a custom User model and customized UserAdmin if it matters.

My dependencies:
{{{
django-crispy-forms==1.6.0
django-mptt==0.8.3
django-rest-swagger==0.3.5
django-solo==1.1.2
django-widget-tweaks==1.4.1
Django==1.9.4             # via django-mptt, django-rest-swagger
djangorestframework==3.3.2
MySQL-python==1.2.5
Pillow==3.1.1
pytz==2015.7
PyYAML==3.11              # via django-rest-swagger
uWSGI==2.0.12
}}}

It comes up when building with Docker `FROM python:2.7` and `python:2.7.11` images.

I can't share code, because it's proprietary, but it would be too big to show anyway."	Bug	closed	Core (Management commands)	1.9	Release blocker	invalid			Unreviewed	0	0	0	0	0	1
