Skip to content

Commit 2b32c81

Browse files
committed
Open the FD
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 934c5b6 commit 2b32c81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def load_from(self, fd):
190190
def save(self, filename, encoding, lines=0):
191191
fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.TRUNC,
192192
stat.S_IRUSR | stat.S_IWUSR)
193-
with io.open(filename, 'w', encoding=encoding,
193+
with io.open(fd, 'w', encoding=encoding,
194194
errors='ignore') as hfile:
195195
with FileLock(hfile):
196196
self.save_to(hfile, self.entries, lines)

0 commit comments

Comments
 (0)