]> arthur.barton.de Git - bup.git/blob - lib/bup/io.py
512d36434ed57e800f3b1f647a8982a909ec6ac2
[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
11     def path_msg(x):
12         """Return a string representation of a path."""
13         # FIXME: configurability (might git-config quotePath be involved?)
14         return x.decode(errors='backslashreplace')
15 else:
16     def byte_stream(file):
17         return file
18
19     def path_msg(x):
20         """Return a string representation of a path."""
21         # FIXME: configurability (might git-config quotePath be involved?)
22         return x