Luigi: AttributeError during logging setup with Python 2.7

Created on 29 Nov 2018  路  7Comments  路  Source: spotify/luigi

Hi,

I upgraded to luigi 2.8.0 and experience an AttributeError that occurs within the new setup_logging.py. Here is the important part of the stack trace:

  File ".../lib/python2.7/site-packages/luigi/cmdline.py", line 9, in luigi_run
    run_with_retcodes(argv)
  File ".../lib/python2.7/site-packages/luigi/retcodes.py", line 81, in run_with_retcodes
    InterfaceLogging.setup(env_params)
  File ".../lib/python2.7/site-packages/luigi/setup_logging.py", line 74, in setup
    configured = cls._section(opts)
  File ".../lib/python2.7/site-packages/luigi/setup_logging.py", line 42, in _section
    logging_config = cls.config['logging']
AttributeError: LuigiConfigParser instance has no attribute '__getitem__'

cls.config is a ConfigParser instance which does not implement __getitem__ in Python 2.7 (which I'm forced to use -.-). This could be fixed by using cls.config.options('logging') instead. I checked, and this is the only place where items are used.

https://github.com/spotify/luigi/blob/0a098f6f99da0bad03af56a057b9a15254d1a957/luigi/setup_logging.py#L42

Adding @orsinium here who is maybe faster to fix this. I could create a PR on Friday.

Most helpful comment

Wow. Thank you. I'll fix it asap today.

All 7 comments

Wow. Thank you. I'll fix it asap today.

Thanks @riga for reporting and @orsinium for quick response! I'll review once it comes through and see about pushing a 2.8.1 hotfix (cc: @honnix )

Thanks for reporting! Yeah let's make a hotfix release afterwards.

PR is here

How is this issue going? We encountered the same issue, but only after upgrading to 2.8.1 which was released yesterday.

@riga Were you actually using the HEAD version not 2.8.0? The aforementioned bug was introduce in https://github.com/spotify/luigi/pull/2483 which is not part of 2.8.0.

Yes, sorry for the confusion!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leafjungle picture leafjungle  路  7Comments

stephenpascoe picture stephenpascoe  路  4Comments

boombard picture boombard  路  5Comments

alfonsomhc picture alfonsomhc  路  3Comments

AndresUrregoAngel picture AndresUrregoAngel  路  4Comments