mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-03 13:07:24 +00:00
Use Python 2 for write_multiple_offsets
This aligns with ut_test.py . Using an older Python also allows compatibility with the older macOS 10.12 Travis CI. References #1323.
This commit is contained in:
parent
1f796d432d
commit
4d1f5c899f
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python2
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -11,7 +11,8 @@ filename = sys.argv[1]
|
|||||||
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
|
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
|
||||||
try:
|
try:
|
||||||
for i in range(2, len(sys.argv), 2):
|
for i in range(2, len(sys.argv), 2):
|
||||||
data = bytes("a" * int(sys.argv[i+1]), 'utf-8')
|
data = "a" * int(sys.argv[i+1])
|
||||||
os.pwrite(fd, data, int(sys.argv[i]))
|
os.lseek(fd, int(sys.argv[i]), os.SEEK_SET)
|
||||||
|
os.write(fd, data)
|
||||||
finally:
|
finally:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user