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),
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))
@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')
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'
open(path, 'w').close()
- 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]
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'
open(path, 'w').close()
- 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]
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'
open(path, 'w').close()
- 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]