Ticket #2253: unicode.diff

File unicode.diff, 0.9 kB (added by jun66j5, 1 year ago)
  • wikirename/util.py

    old new  
    11#! /usr/bin/python 
    22from trac.core import * 
    33from trac.env import * 
     4from trac.util.text import unicode_quote 
    45 
    56import sys 
    67import sre 
     
    6869    if cursor.rowcount > 0: 
    6970        # Change the directory where the attachments are stored, if there were any 
    7071        debug('Moving all attachments on file system') 
    71         from_path = os.path.join(env.path, 'attachments', 'wiki', urllib.quote(oldname)) 
    72         to_path = os.path.join(env.path, 'attachments', 'wiki', urllib.quote(newname)) 
     72        from_path = os.path.join(env.path, 'attachments', 'wiki', unicode_quote(oldname)) 
     73        to_path = os.path.join(env.path, 'attachments', 'wiki', unicode_quote(newname)) 
    7374        debug('Moving from %r to %r', from_path, to_path) 
    7475        os.renames(from_path, to_path) 
    7576