curdling icon indicating copy to clipboard operation
curdling copied to clipboard

Log level choosing is broken for python3.6.3

Open MarSoft opened this issue 8 years ago • 0 comments

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().

MarSoft avatar Dec 17 '17 02:12 MarSoft