From 677535171b5aaf7ba5c0aeb1ee81f911da396ad4 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Sat, 28 Jun 2014 12:52:25 +0200 Subject: [PATCH] Fix synchronization when pictogram names have special characters --- CHANGES.rst | 8 ++++++++ VERSION | 2 +- rando/core/management/commands/sync_content.py | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 353f03deb..5ae3bea1c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,14 @@ CHANGELOG ========= +1.29.2 (2014-06-28) +------------------- + +**BUG fixes** + +* Fix synchronization when pictogram names have special characters (url encoded) + + 1.29.1 (2014-06-26) ------------------- diff --git a/VERSION b/VERSION index 83cf0d951..412114252 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.29.1 +1.29.2 diff --git a/rando/core/management/commands/sync_content.py b/rando/core/management/commands/sync_content.py index 3531730a5..ad895a232 100644 --- a/rando/core/management/commands/sync_content.py +++ b/rando/core/management/commands/sync_content.py @@ -5,6 +5,7 @@ from os.path import join, getmtime, dirname, getsize from os import makedirs, utime import errno +import urllib2 from django.core.management.base import BaseCommand from django.utils.http import http_date, parse_http_date_safe @@ -71,10 +72,11 @@ def __init__(self, url, language=None, client=None, stdout=None, stderr=None): self.stdout = stdout or sys.stdout self.stderr = stderr or sys.stderr - self.path = join(settings.INPUT_DATA_ROOT, self.language, self.url) + unquoted = urllib2.unquote(self.url) + self.path = join(settings.INPUT_DATA_ROOT, self.language, unquoted) # All files are downloaded in a separate folder. # And copied to INPUT_DATA_ROOT if whole sync is successful. - self.path_tmp = join(settings.INPUT_TMP_ROOT, self.language, self.url) + self.path_tmp = join(settings.INPUT_TMP_ROOT, self.language, unquoted) self.reply = None def pull_if_modified(self):