Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/t/thashsplit.py \
lib/bup/t/toptions.py \
lib/bup/t/tshquote.py \
lib/bup/t/thashsplit.py \
lib/bup/t/toptions.py \
lib/bup/t/tshquote.py \
+ lib/bup/t/tvint.py \
+ lib/bup/t/txstat.py
endif
# The "pwd -P" here may not be appropriate in the long run, but we
endif
# The "pwd -P" here may not be appropriate in the long run, but we
# Assumes (of course) this file is at the top-level of the source tree
# Assumes (of course) this file is at the top-level of the source tree
-_bup_tmp = realpath(dirname(__file__) + '/t/tmp')
+_bup_tmp = realpath(dirname(__file__.encode('iso-8859-1')) + b'/t/tmp')
try:
os.makedirs(_bup_tmp)
except OSError as e:
try:
os.makedirs(_bup_tmp)
except OSError as e:
PyObject *access_py, *modification_py;
struct timespec ts[2];
PyObject *access_py, *modification_py;
struct timespec ts[2];
- if (!PyArg_ParseTuple(args, "is((Ol)(Ol))i",
+ if (!PyArg_ParseTuple(args, "i" cstr_argf "((Ol)(Ol))i",
&fd,
&path,
&access_py, &(ts[0].tv_nsec),
&fd,
&path,
&access_py, &(ts[0].tv_nsec),
PyObject *access_py, *modification_py;
long long access_us, modification_us; // POSIX guarantees tv_usec is signed.
PyObject *access_py, *modification_py;
long long access_us, modification_us; // POSIX guarantees tv_usec is signed.
- if (!PyArg_ParseTuple(args, "s((OL)(OL))",
+ if (!PyArg_ParseTuple(args, cstr_argf "((OL)(OL))",
path,
&access_py, &access_us,
&modification_py, &modification_us))
path,
&access_py, &access_us,
&modification_py, &modification_us))
@wvtest
def test_atomically_replaced_file():
with no_lingering_errors():
@wvtest
def test_atomically_replaced_file():
with no_lingering_errors():
- with test_tempdir('bup-thelper-') as tmpdir:
- target_file = os.path.join(tmpdir, 'test-atomic-write')
+ with test_tempdir(b'bup-thelper-') as tmpdir:
+ target_file = os.path.join(tmpdir, b'test-atomic-write')
with atomically_replaced_file(target_file, mode='w') as f:
f.write('asdf')
with atomically_replaced_file(target_file, mode='w') as f:
f.write('asdf')
if not xstat._bup_utimensat:
return
with no_lingering_errors():
if not xstat._bup_utimensat:
return
with no_lingering_errors():
- with test_tempdir('bup-txstat-') as tmpdir:
- path = tmpdir + '/foo'
+ with test_tempdir(b'bup-txstat-') as tmpdir:
+ path = tmpdir + b'/foo'
- frac_ts = (0, 10**9 / 2)
+ frac_ts = (0, 10**9 // 2)
xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0)
st = _helpers.stat(path)
atime_ts = st[8]
xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0)
st = _helpers.stat(path)
atime_ts = st[8]
if not xstat._bup_utimes:
return
with no_lingering_errors():
if not xstat._bup_utimes:
return
with no_lingering_errors():
- with test_tempdir('bup-txstat-') as tmpdir:
- path = tmpdir + '/foo'
+ with test_tempdir(b'bup-txstat-') as tmpdir:
+ path = tmpdir + b'/foo'
- frac_ts = (0, 10**6 / 2)
+ frac_ts = (0, 10**6 // 2)
xstat._bup_utimes(path, (frac_ts, frac_ts))
st = _helpers.stat(path)
atime_ts = st[8]
xstat._bup_utimes(path, (frac_ts, frac_ts))
st = _helpers.stat(path)
atime_ts = st[8]
if not xstat._bup_lutimes:
return
with no_lingering_errors():
if not xstat._bup_lutimes:
return
with no_lingering_errors():
- with test_tempdir('bup-txstat-') as tmpdir:
- path = tmpdir + '/foo'
+ with test_tempdir(b'bup-txstat-') as tmpdir:
+ path = tmpdir + b'/foo'
- frac_ts = (0, 10**6 / 2)
+ frac_ts = (0, 10**6 // 2)
xstat._bup_lutimes(path, (frac_ts, frac_ts))
st = _helpers.stat(path)
atime_ts = st[8]
xstat._bup_lutimes(path, (frac_ts, frac_ts))
st = _helpers.stat(path)
atime_ts = st[8]