Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with notifiers import (Notification Handler) #464

Open
subhamagrawal1 opened this issue Nov 3, 2023 · 1 comment
Open

Issue with notifiers import (Notification Handler) #464

subhamagrawal1 opened this issue Nov 3, 2023 · 1 comment

Comments

@subhamagrawal1
Copy link

Describe the bug
The import of NotificationHandler from notifiers.logging is blocking my code, the entire script is stuck on that part and if i do Ctrl + C then the script gets killed with stacktrace showing that it is stuck in that line, if i comment it out from imports all works well.

File "server.py", line 10, in
from notifiers.logging import NotificationHandler
File "/home/nvidia/.local/lib/python3.8/site-packages/notifiers/init.py", line 4, in
from .core import all_providers
File "/home/nvidia/.local/lib/python3.8/site-packages/notifiers/core.py", line 13, in
from .utils.helpers import dict_from_environs
File "/home/nvidia/.local/lib/python3.8/site-packages/notifiers/utils/helpers.py", line 3, in
from distutils.util import strtobool
File "", line 991, in _find_and_load
File "", line 971, in _find_and_load_unlocked
File "", line 914, in _find_spec
File "/usr/local/lib/python3.8/dist-packages/_distutils_hack/init.py", line 97, in find_spec
return method()
File "/usr/local/lib/python3.8/dist-packages/_distutils_hack/init.py", line 108, in spec_for_distutils
mod = importlib.import_module('setuptools._distutils')
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.8/dist-packages/setuptools/init.py", line 16, in
from .dist import Distribution
File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 27, in
from .extern.packaging.markers import InvalidMarker, Marker
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/markers.py", line 11, in
from ._parser import (
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/_parser.py", line 10, in
from ._tokenizer import DEFAULT_RULES, Tokenizer
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/_tokenizer.py", line 6, in
from .specifiers import Specifier
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/specifiers.py", line 26, in
from .utils import canonicalize_version
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/utils.py", line 8, in
from .tags import Tag, parse_tag
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/tags.py", line 26, in
logger = logging.getLogger(name)
File "/usr/lib/python3.8/logging/init.py", line 2025, in getLogger
return Logger.manager.getLogger(name)
File "/usr/lib/python3.8/logging/init.py", line 1298, in getLogger
_acquireLock()
File "/usr/lib/python3.8/logging/init.py", line 225, in _acquireLock
_lock.acquire()
KeyboardInterrupt
^C

To Reproduce

Expected behavior
Import the library as soon as possible and not block the execution of the code.

Additional context
Python version: 3.8
OS: Ubuntu 20.04

@subhamagrawal1 subhamagrawal1 changed the title Issue with notifiers Issue with notifiers import (Notification Handler) Nov 3, 2023
@liiight
Copy link
Owner

liiight commented Apr 29, 2024

This seems unrelated to notifiers and very much related to the logging module. Can you show your code on how you call from notifiers.logging import NotificationHandler?
Also, do you have issues when using other logging handlers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants