Since the contributions by @nicoddemus colorlog calls colorama.init() automatically when being imported.
I think this is wrong. Importing a module shouldn't mangle my sys.stderr/sys.stdout in any way without asking me to (and with no way to prevent it, other than calling colorama.deinit() by hand after importing).
If an user wants to use colorama, they should do this explicitely, not by importing colorlog.
For me, this broke code testing if sys.stderr is None because it then was a colorama-wrapped None, which was totally unexpected.
If you really insist on integrating colorama with colorlog, at least there should be a colorlog.init(). Explicit is better than implicit.
Since the contributions by @nicoddemus colorlog calls
colorama.init()automatically when being imported.I think this is wrong. Importing a module shouldn't mangle my
sys.stderr/sys.stdoutin any way without asking me to (and with no way to prevent it, other than callingcolorama.deinit()by hand after importing).If an user wants to use colorama, they should do this explicitely, not by importing colorlog.
For me, this broke code testing
if sys.stderr is Nonebecause it then was a colorama-wrapped None, which was totally unexpected.If you really insist on integrating colorama with colorlog, at least there should be a
colorlog.init(). Explicit is better than implicit.