~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http.py

  • Committer: John Arbash Meinel
  • Date: 2006-01-16 21:36:37 UTC
  • mto: (1685.1.1 bzr-encoding)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060116213637-2f4cc1c55769f464
Adding an InvalidURL so transports can report they expect utf-8 quoted paths. Updated tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from warnings import warn
24
24
 
25
25
from bzrlib.transport import Transport, Server
 
26
import bzrlib.errors as errors
26
27
from bzrlib.errors import (TransportNotPossible, NoSuchFile, 
27
28
                           TransportError, ConnectionError)
28
 
from bzrlib.errors import BzrError, BzrCheckError
29
29
from bzrlib.branch import Branch
30
30
from bzrlib.trace import mutter
31
31
 
110
110
        This can be supplied with a string or a list
111
111
        """
112
112
        assert isinstance(relpath, basestring)
 
113
        if isinstance(relpath, unicode):
 
114
            raise errors.InvalidURL(relpath, 'paths must not be unicode.')
113
115
        if isinstance(relpath, basestring):
114
116
            relpath_parts = relpath.split('/')
115
117
        else:
189
191
            if e.code == 404:
190
192
                raise NoSuchFile(path, extra=e)
191
193
            raise
192
 
        except (BzrError, IOError), e:
 
194
        except IOError, e:
193
195
            if hasattr(e, 'errno'):
194
196
                mutter('io error: %s %s for has url: %r', 
195
197
                    e.errno, errno.errorcode.get(e.errno), path)