This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add encoding parameter to logging.basicConfig
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: Samuel.Michaels, vinay.sajip
Priority: normal Keywords: patch

Created on 2011-03-18 04:53 by Samuel.Michaels, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
__init__.patch Samuel.Michaels, 2011-03-18 04:53 Adds encoding parameter to basicConfig method
Messages (3)
msg131314 - (view) Author: Samuel Michaels (Samuel.Michaels) Date: 2011-03-18 04:53
Yes, you could just make a custom logging.FileHandler object, but this way is much easier for those who are following the basic logging tutorial.
msg131319 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-03-18 08:03
I've been thinking about adding a handler= keyword argument to basicConfig(), and it seems to me that it would not only cover your use case, but also other cases which require different handlers.

So I'm marking as wontfix for now, but I'll keep the issue open until the handler parameter gets added. Also changing this to Python 3.3, as I can't make API changes to 3.2.
msg133505 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-04-11 07:51
"handlers" parameter now added to logging.basicConfig(), which covers this use case:

logging.basicConfig(handlers=[logging.FileHandler('test.log', 'w', 'utf-8')])

Ref: changeset c9e9142d82d6
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55802
2011-04-11 07:51:06vinay.sajipsetstatus: open -> closed

messages: + msg133505
2011-03-18 08:03:54vinay.sajipsetassignee: vinay.sajip
messages: + msg131319
resolution: wont fix
versions: + Python 3.3, - Python 3.2
2011-03-18 05:01:49ned.deilysetnosy: + vinay.sajip
2011-03-18 04:53:44Samuel.Michaelscreate