Opened 9 years ago
Last modified 9 years ago
#28150 closed Bug
Behavour of django.utils.text.slugify is not consistent — at Version 1
| Reported by: | Marcos Diez | Owned by: | nobody | 
|---|---|---|---|
| Component: | Utilities | Version: | 1.11 | 
| Severity: | Normal | Keywords: | slugify unicode enconding | 
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description (last modified by )
After hours of debugging, I realized the behavior of django.utils.text.slugify is not consistent.
On Python 2.7.12 and Python 3.5.2 ( Ubuntu 16.04 LTS)
original_value = ('test trial', )
slug = slugify(original_value) # returns "test-trial"
but on Python 2.7.12
from __future__ return unicode_literals
original_value = ('test trial', )
slug = slugify(original_value) # returns "utest-trial"
This is serious and inconsistent.
Fixing it is not trivial either because it may cause backwards incompatibility.
If I was in charge I would either:
- Do nothing since python 2.7 will be deprecated
- Deprecate slugify and create slugify2 which is not affected by this bug
Thanks for your time,
Marcos Diez
  Note:
 See   TracTickets
 for help on using tickets.