Bugs item #1461855, was opened at 2006-03-31 04:37 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1461855&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: John Levon (movement) Assigned to: Nobody/Anonymous (nobody) Summary: fdopen() not guaranteed to have Python semantics Initial Comment: The specification for seek() says: seek( offset[, whence]) Note that if the file is opened for appending (mode 'a' or 'a+'), any seek() operations will be undone at the next write. Consider operating on an fdopen()ed file. The Python source simply calls into the OS-provided fdopen(): http://pxr.openlook.org/pxr/source/Modules/posixmodule.c#3530 However, the POSIX standard http://www.opengroup.org/onlinepubs/009695399/functions/fdopen.html says: "Although not explicitly required by this volume of IEEE Std 1003.1-2001, a good implementation of append (a) mode would cause the O_APPEND flag to be set." Thus, to ensure Python semantics, Python's fdopen() must perform an fcntl() to ensure O_APPEND is set. For example, on Solaris, this optional O_APPEND behaviour is not applied: http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/port/stdio/fdopen.c?r=1.22#97 This has recently caused serious problems with the Mercurial SCM. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1461855&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com