#17566: RegexURLResolver.__repr__(self) is not unicode safe.
-------------------------------+---------------------------------------
     Reporter:  otto           |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  reopened
    Component:  Core (URLs)    |                  Version:  1.4-alpha-1
     Severity:  Normal         |               Resolution:
     Keywords:  unicode        |             Triage Stage:  Unreviewed
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+---------------------------------------

Comment (by vitalije):

 Replying to [comment:7 claudep]:
 > If you have an URL pattern with Unicode characters, I think it should
 also be prefixed with 'u'. I still think that current Django code is
 correct.

 Have you tested given django project or look at the attached code, or you
 are just guessing that I forgot to put **u** before ''string literal''?

 I didn't add any unicode url pattern, but admin application did because it
 uses app_name as part of its url patterns. So the problem is generated
 inside django and IMHO should be fixed there. Besides I have placed print
 self.regex.pattern, type(self.regex.pattern) right before the original
 return statement and in console log it was written as type unicode. So it
 actually has proper leading "u" ie it **IS** really unicode, but other
 arguments are strings. I don't know why python has problem with coercing
 all those strings in unicode, but I have verified that in my test
 application the only source of reported error is the above method repr of
 the RegexURLResolver class, and inside it, the only problem is
 regex.pattern being a unicode.

 I did change that method locally in my own installation of django and it
 works for me. If it is not important for other users / or developers to
 make that correction part of their own installations / repository that's
 fine with me. If it is, then here are my 2 cents contribution.

 Vitalije

 PS: I feel like my reporting a bug is not very welcomed. I am grateful for
 all the time and energy that django developers have put in it, and I want
 to give something back to the community. It took me some time and effort
 to register, to write report in English (that is not my primary language),
 to debug code and report back the solution I found, and I don't complain
 about that effort and time. But I would appreciate (and I do believe some
 other programmers like me would appreciate also) if our bug reports are
 investigated more thoroughly before being replied. The next time I (or
 someone like me) find a bug in django, it can happen very easily that we
 wouldn't care so much to report it. I am not being impatient while waiting
 response from developers, so let them take their time as much as they
 need. But when they decide to respond, please let them take our reports
 seriously. Let them read our reports, test them, test their own hypothesis
 **before** making a reply. It would make us more willing to report. If
 there is something wrong with my report then please educate me how to make
 better report and by doing it you would make me feel that I owe you more
 good reports. That way there will be soon great number of good reports for
 every single bug, we users find. It is very easy to turn people away (not
 me, I believe), but not so easy to inspire them to get involved. Having
 said that I do hope that we will be more and more understanding each other
 in the future.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17566#comment:8>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to