~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

[merge] Storage filename escaping

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from copy import deepcopy
25
25
from stat import *
26
26
import sys
 
27
import urllib
27
28
from unittest import TestSuite
28
29
 
29
30
from bzrlib.trace import mutter
597
598
 
598
599
def urlescape(relpath):
599
600
    """Escape relpath to be a valid url."""
600
 
    # TODO utf8 it first. utf8relpath = relpath.encode('utf8')
601
 
    import urllib
 
601
    if isinstance(relpath, unicode):
 
602
        relpath = relpath.encode('utf-8')
602
603
    return urllib.quote(relpath)
603
604
 
604
605