[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

i18n + svn:keywords substitution may break future python scripts

From: Grzegorz Adam Hankiewicz <gradha_at_titanium.sabren.com>
Date: 2005-06-18 01:09:40 CEST


I have a python script which includes this line:

 __date__ = "$Date$"

This file has a svn:mime-type "text/plain; charset=US-ASCII",
but when svn substitutes the string it looks like this because my
environment is set to Spanish:

 __date__ = "$Date: 2005-06-18 00:26:43 +0200 (sáb, 18 jun 2005) $"

Between brackets, utf8 sáb is in latin1 sb, shortcut for sbado,
or saturday. Trying to run this script shows the following runtime
warning with python 2.3.3:

 sys:1: DeprecationWarning: Non-ASCII character '\xc3' in file
 ./frequent-task-reminder.py on line 21, but no encoding declared;
 see http://www.python.org/peps/pep-0263.html for details

Shouldn't svn downgrade $Date$ to an US-ASCII version of sb like
replacing the accent with the same letter without accent?

Since the server web interface shows the same file with an English
substitution, does this mean that somebody checking out the source
with an exotic user environment may get even more serious breakage,
especially when a future version of Python changes from warnings
to errors?

Is there any way to get the date replaced always in rfc-2822 format?
After all, if I wanted the message i18nised I would expect the Date
keyword to be replaced with "Fecha", in Spanish.

The script can be found at:


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Jun 18 01:12:10 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.