[issue20428] _Py_open does not work with O_CREAT

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > In file included from ./Modules/_localemodule.c:404:0, I don't see where _Py_open() is used in _localemodule.c. I didn't find a call to _Py_open() using O_CREAT. In fact, O_CREAT is not used in the C code of Python. (Except dbmopen in the dbm module, but it

[issue20428] _Py_open does not work with O_CREAT

2014-01-28 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: > What is the current behaviour? I don't think the behaviour is defined. At least, I know it causes recent GCC/glibc combination to throw a compilation error when _FORTIFY_SOURCE is defined: http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/io/open_2

[issue20428] _Py_open does not work with O_CREAT

2014-01-28 Thread STINNER Victor
STINNER Victor added the comment: I already search the "default mode" but I didn't see it in the manual page. Is it 0666? > The _Py_open function in Python/fileutils.c cannot be given correctly the > flag O_CREAT. What is the current behaviour? A new _Py_open_mode() function can be added. Wh

[issue20428] _Py_open does not work with O_CREAT

2014-01-28 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti: The _Py_open function in Python/fileutils.c cannot be given correctly the flag O_CREAT. According to the POSIX spec, open(2) _must_ be given an additional mode argument when O_CREAT is used. _Py_open should be fixed to either to use a reasonable defaul