curdling
curdling copied to clipboard
Log level choosing is broken for python3.6.3
When running on python 3.6.3 (and probably other py3 versions) and specifying -l option (after fixing #89), you will get error:
usage: curd [-h] [-l {}] [--log-file LOG_FILE] [--log-name LOG_NAME] [-q] [-v]
{install,uninstall,freeze} ...
curd: error: argument -l/--log-level: invalid choice: 'DEBUG' (choose from )
The problem is in curdling/tool/__init__.py, around line 236: in py3, logging._levelToName keys don't contain names, only numeric values. Hence resulting list is empty.
This is trivial to fix (just use .values()), but it should also be tested against other py3 versions - and some autotests should probably be added for curdling.tool.main().