﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28947	str(path) causes TypeError when using translatable URL patterns	Tilmann Becker	Tilmann Becker	"Using [[https://docs.djangoproject.com/en/2.0/topics/i18n/translation/#translating-url-patterns|translatable URL patterns]] like this

{{{
from django.utils.translation import gettext_lazy as _

p = path(_('example/'), ExampleView.as_view())
print(p)

# or

p = re_path(_(r'^example/$'), ExampleView.as_view())
print(p)
}}}

causes 

{{{
TypeError: __str__ returned non-string (type __proxy__)
}}}

It should print a string representation of the URL pattern instead:

{{{
<URLPattern 'example/''>
}}}


This affects some consumers of URL patterns: 
- [[https://docs.djangoproject.com/en/2.0/ref/contrib/admin/admindocs/|django.contrib.admindocs]] returns HTTP500 for ''admin/docs/views/''
- possibly Django REST Framework ''SchemaGenerator,'' when fixing [[https://github.com/encode/django-rest-framework/issues/5675|this error]] by using ''str(pattern)''
"	Bug	closed	Core (URLs)	2.0	Release blocker	fixed			Ready for checkin	1	0	0	0	0	0
