Opened 13 years ago

Closed 13 years ago

#15795 closed Bug (fixed)

[patch] __repr__ for RegexURLPattern not unicode safe

Reported by: Mark Raddatz <mraddatz@…> Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords: debug unicode
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

An instance of RegexURLPattern is returned by the url() function, which can be used as an argument to patterns() for the URLConf. The url arguments for regex and name could contain unicode. However, the __repr__ function handle this data as bytestring and could raise a UnicodeDecodeError: 'ascii' codec can't decode byte. RegexURLResolver should be affected too.

Attachments (1)

urlresolvers-r16022.diff (898 bytes ) - added by Mark Raddatz <mraddatz@…> 13 years ago.
Patch that adds smart_str to the repr() function.

Download all attachments as: .zip

Change History (5)

by Mark Raddatz <mraddatz@…>, 13 years ago

Attachment: urlresolvers-r16022.diff added

Patch that adds smart_str to the repr() function.

comment:1 by Carl Meyer, 13 years ago

Easy pickings: unset
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Carl Meyer, 13 years ago

Easy pickings: set

comment:3 by Jannis Leidel, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Luke Plant, 13 years ago

Resolution: fixed
Status: newclosed

In [16158]:

Fixed #15795 - __repr__ for RegexURLPattern not unicode safe

Thanks to Mark Raddatz for the report and patch

Note: See TracTickets for help on using tickets.
Back to Top