#28663: Check for incorrectly migrated django.urls.path calls
---------------------------------------+----------------------------
               Reporter:  Chris Lamb   |          Owner:  nobody
                   Type:  New feature  |         Status:  new
              Component:  Core (URLs)  |        Version:  2.0
               Severity:  Normal       |       Keywords:  check urls
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+----------------------------
 I recently moved a project to Django 2.x, including moving to
 ``django.urls.path``. However, I wasn't careful enough in the details so
 ended up migrating, for example:

 {{{#!python
     from django.conf.urls import url

     url('^faq$', views.faq,
         name='faq'),
 }}}

 to

 {{{#!python
     from django.urls import path

     path('^faq$', views.faq,
          name='faq'),
 }}}

 This doesn't cause any errors (!) but results in, for example,
 {{{reverse('faq')}}} returning the (encoded) url {{{/%5Efaq$}}}.

 As this is a) likely to be very common during the migration with a high
 cost of a true positive, combined with b) the fact that the chance of a
 false positive is fairly low, I suggest we add a check for this.

 (PR incoming...)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28663>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.fdb4f58027b8dcdb8bddcb77469fe808%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to