Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12980 closed (fixed)

locale formats should use raw strings

Reported by: loewis 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: UI/UX:

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 loewis 4 years ago.
12980-r13045.diff (3.8 KB) - added by ramiro 4 years ago.
loewis' patch updated to post [13039] and [13045].

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by loewis

comment:1 Changed 4 years ago by jezdez

  • Component changed from Uncategorized to Translations
  • Has patch set
  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by ramiro

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.

Changed 4 years ago by ramiro

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

comment:3 Changed 4 years ago by jezdez

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

(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 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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.