[issue11877] Change os.fsync() to support physical backing store syncs

Charles-François Natali report at bugs.python.org
Thu May 12 20:14:37 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

Calling fsync on a file descriptor referring to a tty doesn't make much sense.
On Linux, this fails with EINVAL:
$ python -c 'import os; os.fsync(1)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 22] Invalid argument

So if the full sync fails on ttys, it shouldn't be a problem: since
the default performs a classical fsync, this won't break compatibility
with existing code anyway.
So I think you should stick with the previous version (well, if the
full sync fails on other FDs, then it's another story, but in that
case it should just be dropped altogether if it's not reliable...).

By the way, it's "appropriate", not "approbiate". You made the same
typo in your patch.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11877>
_______________________________________


More information about the Python-bugs-list mailing list