-
Notifications
You must be signed in to change notification settings - Fork 215
Closed
Labels
Description
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.