Vinay Sajip added the comment:

This issue had dropped off my radar, thanks for bringing it back into view.

I see that the patch follows Antoine's suggestion of a "chown" parameter, but 
I'm not sure that's the best way to provide this functionality. What concerns 
me about a "chown" parameter:

1. It's POSIX only, which makes me not want to add it to the API for all users 
(even though they don't need to specify it, as it's defaulted). It's not a 
really common use case, even on POSIX.
2. It makes the argument list for the rotating handlers even more unwieldy than 
it is at present. While it's not pretty now, I don't want to make it uglier.
3. If other things like this are requested in the future (e.g. "chmod" as 
mentioned in the original post), then it makes the argument lists longer and 
longer if this approach is used to satisfy those requirements.

Instead, a mixin which redefined _open would seem to fulfil the requirements, 
and the same strategy could be used to cater for other requirements without any 
stdlib changes. Of course it requires the developer to do a little bit more 
work than having the work done for them in the stdlib, but I think it's 
reasonable to meet the requirement this way as it's relatively uncommon. I 
don't mind adding an working example of this to the cookbook, making it even 
less work for developers to adopt this approach. While the _open method is 
technically private as it begins with an underscore, I have no problem letting 
subclasses override it.

Also, ISTM that your patch would fail at the shutil.chown call if the log file 
didn't already exist, which is a not uncommon scenario.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18345>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to