/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/urlutils.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-12 23:44:49 UTC
  • mfrom: (6963.2.17 python3-d)
  • Revision ID: jelmer@jelmer.uk-20180612234449-e0ugedl5s20kvyjo
Merge lp:~jelmer/brz/python3-weave

Show diffs side-by-side

added added

removed removed

Lines of Context:
937
937
        :param relpath: relative url string for relative part of remote path.
938
938
        :return: urlencoded string for final path.
939
939
        """
940
 
        if not isinstance(relpath, str):
 
940
        # pad.lv/1696545: For the moment, accept both native strings and unicode.
 
941
        if isinstance(relpath, str):
 
942
            pass
 
943
        elif isinstance(relpath, unicode):
 
944
            try:
 
945
                relpath = relpath.encode()
 
946
            except UnicodeEncodeError:
 
947
                raise InvalidURL(relpath)
 
948
        else:
941
949
            raise InvalidURL(relpath)
942
950
        relpath = _url_hex_escapes_re.sub(_unescape_safe_chars, relpath)
943
951
        if relpath.startswith('/'):