                  except TypeError:
                      return None
  
                  try:
                      userid = smart_unicode(auth_parts[0])
                      password = smart_unicode(auth_parts[2])
                  except DjangoUnicodeDecodeError:
                      return None
  
                  return self.authenticate_credentials(userid, password)
  
 
</s> remove             base_media_type, params = parse_header(accepted_media_type)
 </s> add             base_media_type, params = parse_header(accepted_media_type.encode('ascii')) </s> remove         except MultiPartParserError, exc:
 </s> add         except MultiPartParserError as exc: </s> remove         except (ExpatError, ETParseError, ValueError), exc:
 </s> add         except (ExpatError, ETParseError, ValueError) as exc: </s> remove             msg = "Invalid pk '%s' - object does not exist." % smart_unicode(data)
 </s> add             msg = "Invalid pk '%s' - object does not exist." % smart_text(data) </s> remove             msg = "Invalid pk '%s' - object does not exist." % smart_unicode(data)
 </s> add             msg = "Invalid pk '%s' - object does not exist." % smart_text(data)
                    userid = smart_text(auth_parts[0])
                    password = smart_text(auth_parts[2])
                  except TypeError:
                      return None
  
                  try:
                    userid = smart_text(auth_parts[0])
                    password = smart_text(auth_parts[2])
                    userid = smart_text(auth_parts[0])
                    password = smart_text(auth_parts[2])
                  except DjangoUnicodeDecodeError:
                      return None
  
                  return self.authenticate_credentials(userid, password)
  
keep keep keep keep replace replace keep keep keep keep keep
 First passing test under p3k \o/ 
rest_framework/authentication.py