Skip to content

Commit 4af3478

Browse files
committed
sync: Open file in binary mode
This fixes the pylint warning about no file encoding being specified.
1 parent 2b2c10b commit 4af3478

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from optparse import OptionParser
66

77

8-
def lazybox_sync(_, filenames: list[str]):
8+
def sync(_, filenames: list[str]):
99
if filenames:
1010
failed = False
1111

1212
for name in filenames:
1313
try:
14-
with open(name, "r+") as io:
14+
with open(name, "rb+") as io:
1515
os.fsync(io)
1616
except OSError as e:
1717
failed = True
@@ -31,4 +31,4 @@ def lazybox_sync(_, filenames: list[str]):
3131
)
3232
parser.add_option("--help", action="help", help="show usage information and exit")
3333

34-
lazybox_sync(*parser.parse_args())
34+
sync(*parser.parse_args())

0 commit comments

Comments
 (0)