[pypy-issue] [issue928] syslog.openlog behavior different from CPython

Amaury Forgeot d Arc tracker at bugs.pypy.org
Wed Nov 16 11:29:04 CET 2011

Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

Yes, pypy should be updated. Fortunately you can do it in your local copy.

in lib_pypy/syslog.py, the function header:
    def openlog(ident, option, facility):
should be changed to:
    def openlog(ident=None, option=0, facility=LOG_USER):

Can you try and see if it fixes your issue?

Careful though, this function still has a bug: "man openlog" says:
The argument ident in the call of openlog() is probably stored as-is. Thus, if the 
string it points to is changed, syslog() may start prepending the changed string, and 
if the string it points to ceases to exist, the results are undefined. Most portable 
is to use a string constant.
CPython keeps a global reference to the string, pypy should probably store the 
ctypes.c_char_p buffer instead.

nosy: +afa
status: unread -> chatting

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list