/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/transport/local.py

  • Committer: Martin
  • Date: 2017-06-10 01:57:00 UTC
  • mto: This revision was merged to the branch mainline in revision 6679.
  • Revision ID: gzlist@googlemail.com-20170610015700-o3xeuyaqry2obiay
Go back to native str for urls and many other py3 changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
    def __init__(self, base):
52
52
        """Set the base path where files will be stored."""
53
 
        if not base.startswith(b'file://'):
 
53
        if not base.startswith('file://'):
54
54
            raise AssertionError("not a file:// url: %r" % base)
55
 
        if base[-1] != b'/':
56
 
            base = base + b'/'
 
55
        if base[-1] != '/':
 
56
            base = base + '/'
57
57
 
58
58
        # Special case : windows has no "root", but does have
59
59
        # multiple lettered drives inside it. #240910
60
 
        if sys.platform == 'win32' and base == b'file:///':
61
 
            base = b''
 
60
        if sys.platform == 'win32' and base == 'file:///':
 
61
            base = ''
62
62
            self._local_base = ''
63
63
            super(LocalTransport, self).__init__(base)
64
64
            return
189
189
        :param relpath: Location to put the contents, relative to base.
190
190
        :param raw_bytes:   String
191
191
        """
192
 
        if not isinstance(raw_bytes, str):
 
192
        if not isinstance(raw_bytes, bytes):
193
193
            raise TypeError(
194
194
                'raw_bytes must be a plain string, not %s' % type(raw_bytes))
195
195
        path = relpath