Skip to content

colorlog shouldn't call colorama.init() implicitely #13

@The-Compiler

Description

@The-Compiler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions