[issue26606] logging.baseConfig is missing the encoding parameter

Vinay Sajip report at bugs.python.org
Fri Apr 1 12:03:29 EDT 2016


Vinay Sajip added the comment:

> you have also to remember to restore sys.stdout

I'm not sure you understand how it works. The value of sys.stdout isn't changed, so why does it need to be restored?

> for non-English languages it would be more appropriate to use codecs.open() instead of just open()

codecs.open() for older versions of Python, perhaps, but in newer Pythons (this issue is marked for Python 3.5), open is io.open which takes an encoding parameter.

basicConfig() is meant for the simplest cases, so you have to draw the line somewhere as to what "basic" means. I don't propose to change where the line is drawn - and AFAIK this is the first time it's come up, so it looks as if the many non-English speaking Python users are managing just fine with basicConfig() as it is ... note that this kind of thing is always a judgement call.

> The complexity of the code grows and increases a danger of "more code, more bugs".

Maybe that's why I'm choosing not to increase the complexity of my code ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26606>
_______________________________________


More information about the Python-bugs-list mailing list