Changes by Steve Dower steve.do...@microsoft.com:
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23668
___
Roundup Robot added the comment:
New changeset cb7ca578a0c3 by Steve Dower in branch 'default':
Issue #23668: Regenerates posixmodule.c.h for new ifdefs
https://hg.python.org/cpython/rev/cb7ca578a0c3
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 505bf6086ec5 by Steve Dower in branch 'default':
Issue #23668: Adds support for os.truncate and os.ftruncate on Windows
https://hg.python.org/cpython/rev/505bf6086ec5
New changeset eba85ae7d128 by Steve Dower in branch 'default':
Issue #23668:
Changes by Steve Dower steve.do...@microsoft.com:
--
stage: - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23668
___
___
STINNER Victor added the comment:
23668_3.patch looks good to me.
I agree that handling EINTR is not needed on Windows, and so there is no need
for an helper function like _Py_open_noraise().
--
___
Python tracker rep...@bugs.python.org
Steve Dower added the comment:
Sorry, _Py_open requires a double encoding (wchar-char-wchar), which is why
I'm not going to use it.
_Py_wfopen takes a mode string rather than _O_* flags, and so implicitly
includes _O_CREAT.
Guessing we should add _Py_wopen?
--
STINNER Victor added the comment:
Sorry, I still fail to see how _Py_open() or _Py_open_noraise() add the O_CREAT
flag: they are thin wrapper to the underyling open() function. I cannot see
O_CREAT in Python/fileutils.c. Could you please show me that the line number
adding O_CREAT implictly?
Steve Dower added the comment:
I responded to Victor's suggestion about _Py_open instead of _open, but on
rereading I see that it also handles EINTR.
AFAICT (from https://msdn.microsoft.com/en-us/library/5814770t.aspx, mainly),
Windows isn't ever going to return EINTR from the CRT. I don't
Steve Dower added the comment:
Yep, all the way back to VS 2005 and Windows 95. Not sure why it wasn't used
previously (_chsize doesn't support 64-bit values, which is a reasonable reason
to not use it).
--
title: Support os. - Support os.ftruncate on Windows