https://code.djangoproject.com/ticket/22295