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

luigi.toml file generating error with 2.8.11, but works with 2.8.9 #2898

Closed
James-Hudson3010 opened this issue Feb 14, 2020 · 3 comments
Closed
Labels

Comments

@James-Hudson3010
Copy link

James-Hudson3010 commented Feb 14, 2020

My luigi.toml file is just this...

[logging]
version = 1.0
disable_existing_loggers = false

[logging.handlers.console]
level = "DEBUG"
class = "logging.StreamHandler"

when using luigi 2.8.9, my task (luigi --module tasks.test Test --local-scheduler) runs just fine.

However, if I upgrade to 2.8.11, I get the following error:

Traceback (most recent call last):
  File "/Users/jamesh/.pyenv/versions/3.7.6/lib/python3.7/logging/config.py", line 563, in configure
    handler = self.configure_handler(handlers[name])
  File "/Users/jamesh/.pyenv/versions/3.7.6/lib/python3.7/logging/config.py", line 697, in configure_handler
    formatter = config.pop('formatter', None)
AttributeError: 'FrozenOrderedDict' object has no attribute 'pop'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/jamesh/depot/test/test_env/lib/python3.7/site-packages/luigi/retcodes.py", line 75, in run_with_retcodes
    worker = luigi.interface._run(argv).worker
  File "/Users/jamesh/depot/test/test_env/lib/python3.7/site-packages/luigi/interface.py", line 211, in _run
    return _schedule_and_run([cp.get_task_obj()], worker_scheduler_factory)
  File "/Users/jamesh/depot/test/test_env/lib/python3.7/site-packages/luigi/interface.py", line 145, in _schedule_and_run
    InterfaceLogging.setup(env_params)
  File "/Users/jamesh/depot/test/test_env/lib/python3.7/site-packages/luigi/setup_logging.py", line 83, in setup
    configured = cls._section(opts)
  File "/Users/jamesh/depot/test/test_env/lib/python3.7/site-packages/luigi/setup_logging.py", line 48, in _section
    logging.config.dictConfig(logging_config)
  File "/Users/jamesh/.pyenv/versions/3.7.6/lib/python3.7/logging/config.py", line 800, in dictConfig
    dictConfigClass(config).configure()
  File "/Users/jamesh/.pyenv/versions/3.7.6/lib/python3.7/logging/config.py", line 571, in configure
    '%r' % name) from e
ValueError: Unable to configure handler 'console'
@James-Hudson3010
Copy link
Author

I checked and it works with 2.8.10 as well. The bug appears in 2.8.11.

@hirolau
Copy link
Contributor

hirolau commented Feb 20, 2020

This is very much related to issue 2879. The standard library logging module expects a mutable dict, but the config for TOML was changed to use in internal FrozenOrderedDict

There are two ways to slove it. Ignore the freezing of the logging section in TOML configs, or create an unfreeze method and call it before passing the dict to the logging config.

@stale
Copy link

stale bot commented Jun 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions.

@stale stale bot added the wontfix label Jun 20, 2020
@stale stale bot closed this as completed Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants