Fix list_route, detail_route with kwargs contains curly bracket in url_path by no-dap · Pull Request #5187 · encode/django-rest-framework (original) (raw)

Error raised at here in routers.py, 258L

regex = route.url.format( 
    prefix=prefix, 
    lookup=lookup, 
    trailing_slash=self.trailing_slash 
) 

Actually, this escaping is not for regex, for formatting string.
I also check that this replace makes well-routed url with inserted kwargs in url_path in my testcase.