Skip to content

[BUG] embed_utils.py breaks StreamHandler terminator for *all* log handlers #660

@jspv

Description

@jspv

Describe the bug
The following code in embed_utils.py which gets loaded on import graphistry

logging.StreamHandler.terminator = ""
logger = logging.getLogger(__name__)

Note it is changing the logging StreamHandler class - not an instance. This is changing every StreamHandler for every library, including every future StreamHandlers, to have a terminator of "" instead of the default "\n". Took me three hours to track down which import of which import of which import was breaking my logging.

Not exactly sure what this code is intended to do in graphistry, but please don't override the standard python classes.

To Reproduce

Python 3.11.12 (main, Apr  8 2025, 14:15:29) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.StreamHandler.terminator
'\n'
>>> h1 = logging.StreamHandler()
>>> h1.terminator
'\n'
>>> import graphistry
>>> logging.StreamHandler.terminator
''
>>> h2 = logging.StreamHandler()
>>> h2.terminator
''
>>> h1.terminator
''

Expected behavior
Namespace unrelated to graphistry should not be modified.

Actual behavior
See above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions