You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Grzegorz Adam Hankiewicz <gr...@titanium.sabren.com> on 2005/06/17 23:09:40 UTC
i18n + svn:keywords substitution may break future python scripts
Hi.
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 sáb, shortcut for sábado,
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 sáb 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:
http://svn.berlios.de/wsvn/ftr/trunk/frequent-task-reminder.py?op=file&rev=0&sc=0
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: i18n + svn:keywords substitution may break future python scripts
Posted by Grzegorz Adam Hankiewicz <gr...@titanium.sabren.com>.
On 2005-06-18, Grzegorz Adam Hankiewicz <gr...@titanium.sabren.com> wrote:
> The script can be found at:
>
> http://svn.berlios.de/wsvn/ftr/trunk/frequent-task-reminder.py?op=file&rev=0&sc=0
Here's a test case:
[gradha@noir:0] [~]$ export LANG="en_GB"
[gradha@noir:0] [~]$ svn cat -r 58 svn://svn.berlios.de/ftr/trunk/frequent-task-reminder.py|grep __date__
__date__ = "$Date: 2005-06-18 01:07:56 +0200 (Sat, 18 Jun 2005) $"
[gradha@noir:0] [~]$ export LANG="es_ES"
[gradha@noir:0] [~]$ svn cat -r 58 svn://svn.berlios.de/ftr/trunk/frequent-task-reminder.py|grep __date__
__date__ = "$Date: 2005-06-18 01:07:56 +0200 (sáb, 18 jun 2005) $"
[gradha@noir:0] [~]$ svn --version
svn, versión 1.1.4 (r13838)
compilado May 13 2005, 06:29:47
...
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org