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