Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12980 closed (fixed)

locale formats should use raw strings

Reported by: Martin v. Löwis Owned by: nobody
Component: Translations Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In a number of locale formats.py files, single backslashes are used to escape letters from datetime formatting. However, in some cases, these escapes now form Python escape characters (e.g. in es/locale.py, which contains backslash-a, denoting the BEL control character).

This patch uses raw strings in all cases where single backslashes are used, even if they wouldn't be strictly necessary. The only exception are files that already use double backslashes.

Attachments (2)

locale.diff (4.6 KB ) - added by Martin v. Löwis 15 years ago.
12980-r13045.diff (3.8 KB ) - added by Ramiro Morales 15 years ago.
loewis' patch updated to post [13039] and [13045].

Download all attachments as: .zip

Change History (6)

by Martin v. Löwis, 15 years ago

Attachment: locale.diff added

comment:1 by Jannis Leidel, 15 years ago

Component: UncategorizedTranslations
Has patch: set
milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 by Ramiro Morales, 15 years ago

Yes, this is something I had noted and tried to fix for es_AR in r12108 (wasn't sure about going either the raw string or the backslash escaping route), although I forgot a '\' before a 's' in DATETIME_FORMAT. We will try to fix this with Fabián Ramirez during the March 6 sprint.

by Ramiro Morales, 15 years ago

Attachment: 12980-r13045.diff added

loewis' patch updated to post [13039] and [13045].

comment:3 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: newclosed

(In [13050]) Fixed #12980 - Use raw strings for locale formats which contain single backslahes. Thanks for report and patch, Martin von Löwis and Ramiro Morales.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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