Code

Opened 3 years ago

Closed 3 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:

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@…> 3 years ago.
Patch that adds smart_str to the repr() function.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by Mark Raddatz <mraddatz@…>

Patch that adds smart_str to the repr() function.

comment:1 Changed 3 years ago by carljm

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by carljm

  • Easy pickings set

comment:3 Changed 3 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 3 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from new to closed

In [16158]:

Fixed #15795 - __repr__ for RegexURLPattern not unicode safe

Thanks to Mark Raddatz for the report and patch

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.