Christian Heimes <li...@cheimes.de> added the comment:
The high level and low level variants behave the same if you pass in the same flags. You are using the append flag in "open()", but you don't pass the os.O_APPEND flag to "os.open()". >>> import os >>> fd = os.open('log', os.O_WRONLY | os.O_APPEND | os.O_CREAT) >>> os.lseek(fd, 1, os.SEEK_SET) 1 >>> os.write(fd, b'foo') 3 >>> os.close(fd) >>> os.stat('log').st_size 3 >>> fd = os.open('log2', os.O_WRONLY | os.O_CREAT) >>> os.lseek(fd, 1, os.SEEK_SET) 1 >>> os.write(fd, b'foo') 3 >>> os.close(fd) >>> os.stat('log2').st_size 4 ---------- nosy: +christian.heimes _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43028> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com