Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27146 closed Bug (needsinfo)

template shows empty string instead of actual content when it contains characters like \x93 and \x94

Reported by: Brian Cassidy Owned by: nobody
Component: Template system Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I believe \x93 and \x94 are quote characters from CP-1252.

I can use {{string|pprint}} and see the data in variable, i can use {{string|length}} and gets its length, but i cannot just print it via {{string}} -- no error is thrown, but the output is empty.

This seems like a bug to me, but I can convinced otherwise. :)

Attachments (1)

27146-test.diff (714 bytes ) - added by Tim Graham 8 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Tim Graham, 8 years ago

It would be quite nice if you could do some investigation yourself and tell us where the bug is. Or even write a test for Django's test suite (django/tests/template_tests) so we at least have an easy way to reproduce it. In general, you should ask "is it a bug?" questions on our our support channels rather than creating a Trac ticket.

comment:2 by Brian Cassidy, 8 years ago

I apologize for the lack of details. Python & Django are not things I use on a daily basis.

I originally enquired about my issue in #django and didn't get much more than a "that's strange" as a response.

I will spend a little time and try to write up a test.

Last edited 8 years ago by Brian Cassidy (previous) (diff)

comment:3 by Tim Graham, 8 years ago

Resolution: needsinfo
Status: newclosed

Thanks, I attached the quick test I wrote up to try to reproduce but it passes on Python 2 and 3, so there's probably some missing information about the exact steps to reproduce. Please reopen or change the resolution based on your investigation.

by Tim Graham, 8 years ago

Attachment: 27146-test.diff added

comment:4 by Brian Cassidy, 8 years ago

Thanks for the update -- I also saw the same result when i tried to add a test. I suspect there are other encoding-related issues happening.

To elaborate on the *actual* scenario we're dealing with: We have a small Django app that parses git diff output and shows what those changes are. The files being diff'ed could come from a variety of OSes in who-knows-what encoding (including CP-1252). I have a feeling that properly reading in the diff output would solve the issue.

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