              try:
                  auth_decoded = base64.b64decode(auth[1]).decode('utf-8')
              except UnicodeDecodeError:
                  auth_decoded = base64.b64decode(auth[1]).decode('latin-1')
              auth_parts = auth_decoded.partition(':')
          except (TypeError, UnicodeDecodeError, binascii.Error):
              msg = _('Invalid basic header. Credentials not correctly base64 encoded.')
              raise exceptions.AuthenticationFailed(msg)
  
          userid, password = auth_parts[0], auth_parts[2]
          return self.authenticate_credentials(userid, password, request)
 
</s> remove         userid, password = auth_parts[0], auth_parts[2]
 </s> add 
            userid, password = auth_decoded.split(':', 1)
        except (TypeError, ValueError, UnicodeDecodeError, binascii.Error):
              try:
                  auth_decoded = base64.b64decode(auth[1]).decode('utf-8')
              except UnicodeDecodeError:
                  auth_decoded = base64.b64decode(auth[1]).decode('latin-1')
            userid, password = auth_decoded.split(':', 1)
        except (TypeError, ValueError, UnicodeDecodeError, binascii.Error):
            userid, password = auth_decoded.split(':', 1)
        except (TypeError, ValueError, UnicodeDecodeError, binascii.Error):
              msg = _('Invalid basic header. Credentials not correctly base64 encoded.')
              raise exceptions.AuthenticationFailed(msg)
  
          userid, password = auth_parts[0], auth_parts[2]
          return self.authenticate_credentials(userid, password, request)
keep keep keep keep replace replace keep keep keep keep keep
 replace partition with split in BasicAuthentication (#8790)

* replace partition with split in BasicAuthentication

* test if basic auth without provided password fails 
rest_framework/authentication.py