/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 bzrlib/smart/request.py

  • Committer: Andrew Bennetts
  • Date: 2008-10-30 03:47:59 UTC
  • mfrom: (3808 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3814.
  • Revision ID: andrew.bennetts@canonical.com-20081030034759-jz7jwoz8j0w6es1k
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
            # with a plain string
304
304
            str_or_unicode = e.object
305
305
            if isinstance(str_or_unicode, unicode):
306
 
                # XXX: UTF-8 might have \x01 (our seperator byte) in it.  We
307
 
                # should escape it somehow.
 
306
                # XXX: UTF-8 might have \x01 (our protocol v1 and v2 seperator
 
307
                # byte) in it, so this encoding could cause broken responses.
 
308
                # Newer clients use protocol v3, so will be fine.
308
309
                val = 'u:' + str_or_unicode.encode('utf-8')
309
310
            else:
310
311
                val = 's:' + str_or_unicode.encode('base64')
316
317
                return FailedSmartServerResponse(('ReadOnlyError', ))
317
318
            else:
318
319
                raise
 
320
        except errors.ReadError, e:
 
321
            # cannot read the file
 
322
            return FailedSmartServerResponse(('ReadError', e.path))
 
323
        except errors.PermissionDenied, e:
 
324
            return FailedSmartServerResponse(
 
325
                ('PermissionDenied', e.path, e.extra))
319
326
 
320
327
    def headers_received(self, headers):
321
328
        # Just a no-op at the moment.