-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Description
Checklist
- I have verified that that issue exists against the
master
branch of Django REST framework. - I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- This is not a usage question. (Those should be directed to the discussion group instead.)
- This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case.
- I have included a failing test
Steps to reproduce
- python3.x (reporduceable on 3.4 - 3.6)
- Install django 2.0beta & latest DRF
- Create simple model
- Create simple HyperlinkedModelSerializer that uses 'url' field instead of 'id'
- Create simple viewset
- run standard django runserver (wsgiref)
- POST new model
Expected behavior
- model gets created without any issues
Actual behavior
- models is created but:
- Exception is raised by wsgiref from here https://github.com/python/cpython/blob/3.6/Lib/wsgiref/headers.py#L43
The issue is that header is of type Hyperlink
, and wsgiref explicitly checks for str
only
It's caused here: https://github.com/encode/django-rest-framework/blob/master/rest_framework/mixins.py#L30
The data is not a str