79211551

Date: 2024-11-21 14:17:09
Score: 9 🚩
Natty: 5.5
Report link

using configuration via INI file is perfect when runniung python script during runtime. When starting my script in rc.local I get KeyError and script is aborted:

Nov 21 14:59:54 RaspiJura4 rc.local[916]: fileConfig('logging.ini') Nov 21 14:59:54 RaspiJura4 rc.local[916]: File "/usr/lib/python3.11/logging/config.py", line 71, in fileConfig Nov 21 14:59:54 RaspiJura4 rc.local[916]: formatters = _create_formatters(cp) Nov 21 14:59:54 RaspiJura4 rc.local[916]: ^^^^^^^^^^^^^^^^^^^^^^ Nov 21 14:59:54 RaspiJura4 rc.local[916]: File "/usr/lib/python3.11/logging/config.py", line 104, in _create_formatters Nov 21 14:59:54 RaspiJura4 rc.local[916]: flist = cp["formatters"]["keys"] Nov 21 14:59:54 RaspiJura4 rc.local[916]: ~~^^^^^^^^^^^^^^ Nov 21 14:59:54 RaspiJura4 rc.local[916]: File "/usr/lib/python3.11/configparser.py", line 979, in getitem Nov 21 14:59:54 RaspiJura4 rc.local[916]: raise KeyError(key) Nov 21 14:59:54 RaspiJura4 rc.local[916]: KeyError: 'formatters'

Is there any idea how to solve this? Best regards Pit

Reasons:
  • Blacklisted phrase (0.5): Best regards
  • Blacklisted phrase (1): regards
  • Blacklisted phrase (1): Is there any
  • Blacklisted phrase (1): how to solve
  • RegEx Blacklisted phrase (1.5): how to solve this?
  • Contains signature (1):
  • Long answer (-1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Filler text (0.5): ^^^^^^^^^^^^^^^^^^^^^^
  • Filler text (0): ^^^^^^^^^^^^^^
  • Low reputation (1):
Posted by: Pit