]> arthur.barton.de Git - bup.git/blob - lib/bup/io.py
Add "do nothing" path_msg to centralize path conversions
[bup.git] / lib / bup / io.py
1
2 from __future__ import absolute_import, print_function
3
4 from bup import compat
5
6
7 if compat.py_maj > 2:
8     def byte_stream(file):
9         return file.buffer
10 else:
11     def byte_stream(file):
12         return file
13
14
15 def path_msg(x):
16     """Return a string representation of a path.
17
18     For now, assume that the destination encoding is going to be
19     ISO-8859-1, which it should be, for the primary current
20     destination, stderr, given the current bup-python.
21
22     """
23     # FIXME: configurability (might git-config quotePath be involved?)
24     return x.decode(encoding='iso-8859-1')