Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28355 closed Bug (fixed)

Widget rendering of non-ASCII date/time formats fails on Python 2

Reported by: Samir Shah Owned by: nobody
Component: Forms Version: 1.11
Severity: Release blocker Keywords: widget
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The change to widget rendering in #28176 (PR) has broken the rendering of field values that contain unicode, on Python 2, when the input.html template is used.

This works in Django 1.11.2:

import datetime
from django import forms

input = forms.TimeInput(format=u'τ-%H:%M')
input.render('my-input', datetime.time(10, 10))

> u'<input type="text" name="my-input" value="\u03c4-10:10" />'

This fails in Django 1.11.3 however and an empty value is rendered instead:

> u'<input type="text" name="my-input" value="" />'

Change History (4)

comment:1 by Samir Shah, 7 years ago

Type: UncategorizedBug

comment:2 by Tim Graham, 7 years ago

Has patch: set
Severity: NormalRelease blocker
Summary: Widget rendering of unicode values fails on Python 2Widget rendering of non-ASCII date/time formats fails on Python 2
Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 81febf4d:

[1.11.x] Fixed #28355 -- Fixed widget rendering of non-ASCII date/time formats on Python 2.

comment:4 by Tim Graham <timograham@…>, 7 years ago

In 42e91cd:

Refs #28355 -- Forwardported 1.11.4 release note.

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