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

No handlers could be found for logger "brother_ql.devicedependent" #38

Open
jwindleGitHub opened this issue Sep 26, 2021 · 3 comments
Open

Comments

@jwindleGitHub
Copy link

Got a new Raspberry Pi Zero, loaded the latest OS, loaded brother_ql_web and get this message:
No handlers could be found for logger "brother_ql.devicedependent"
Traceback (most recent call last):
File "./brother_ql_web.py", line 28, in
except FileNotFoundError as e:
NameError: name 'FileNotFoundError' is not defined

Any suggestions?

@larsfroelich
Copy link

having the same issue

@jwindleGitHub
Copy link
Author

I think that I found that although python3 was installed on my machine it needed to be linked to the python2 executable file in /usr/bin/python

@FriedrichFroebel
Copy link

There are two issues here: The logger error message from the issue title only occurs with Python < 3.2 (see https://docs.python.org/3/howto/logging.html#what-happens-if-no-configuration-is-provided).

For the FileNotFoundError part, the offending block is

try:
with open('config.json', encoding='utf-8') as fh:
CONFIG = json.load(fh)
except FileNotFoundError as e:
with open('config.example.json', encoding='utf-8') as fh:
CONFIG = json.load(fh)
FileNotFoundError has not been defined in Python 2, while /usr/bin/python usually pointed to Python 2 in the past (at least until Ubuntu 20.04 if I am not mistaken). Running python3 brother_ql_web.py should have worked. As soon as the configuration file is available, the undefined FileNotFoundError exception class will not be an issue any more on Python 2 as well, due to the way Python handles such exceptions.

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

3 participants