You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If, for example, I name the above script min.py, do chmod 755 min.py, and then run ./min.py forget, I get divergent behavior when DOIT_CONFIG is commented out or not. If DOIT_CONFIG is commented out, I get:
william@xubuntu-dtrain:~/Projects/life-hacks/crzsnap$ ./min.py forget
Traceback (most recent call last):
File "/home/william/.local/lib/python3.10/site-packages/doit/doit_cmd.py", line 294, in run
return command.parse_execute(args)
File "/home/william/.local/lib/python3.10/site-packages/doit/cmd_base.py", line 150, in parse_execute
return self.execute(params, args)
File "/home/william/.local/lib/python3.10/site-packages/doit/cmd_base.py", line 570, in execute
return self._execute(**exec_params)
File "/home/william/.local/lib/python3.10/site-packages/doit/cmd_forget.py", line 62, in _execute
fornamein forget_list:
TypeError: 'NoneType' object is not iterable
If I do not have DOIT_CONFIG commented, I get a successful run:
Is this intentional or a bug? I'm guessing it is a bug, but am unsure.
Additional Context
This is mostly for future-me when he inevitably forgets.
For the purpose of finalizing a Command to execute, all config sources (including DOIT_CONFIG, config INI/TOML files, and command-line params) are collectedinto the params argument. The default tasks to execute are retrieved from params.
Config values parsed from an INI/TOML file only override command-line arguments if the Command subclass indicates that it supports the option via its cmd_options attribute or similar. The forget command doesnot support default_tasks as a command-line argument. OTOH, config loaded from DOIT_CONFIGbypasses the command-line/config file arg checks and directly modifies params.
Should arguments provided from config INI/TOML files/extra_config also bypass the command-line argument checks?
Environment
OS:
william@xubuntu-dtrain:~/conf/backup$ uname -a
Linux xubuntu-dtrain 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
PLEASE DO NOT USE ISSUE TRACKER TO ASK QUESTIONS: see contributing
Describe the bug
Consider the following python script that imports
doit
:If, for example, I name the above script
min.py
, dochmod 755 min.py
, and then run./min.py forget
, I get divergent behavior whenDOIT_CONFIG
is commented out or not. IfDOIT_CONFIG
is commented out, I get:If I do not have
DOIT_CONFIG
commented, I get a successful run:Is this intentional or a bug? I'm guessing it is a bug, but am unsure.
Additional Context
This is mostly for future-me when he inevitably forgets.
For the purpose of finalizing a
Command
toexecute
, all config sources (includingDOIT_CONFIG
, config INI/TOML files, and command-line params) are collected into theparams
argument. The default tasks to execute are retrieved fromparams
.Config values parsed from an INI/TOML file only override command-line arguments if the
Command
subclass indicates that it supports the option via itscmd_options
attribute or similar. The forget command does not supportdefault_tasks
as a command-line argument. OTOH, config loaded fromDOIT_CONFIG
bypasses the command-line/config file arg checks and directly modifies params.Should arguments provided from config INI/TOML files/
extra_config
also bypass the command-line argument checks?Environment
Upvote & Fund
The text was updated successfully, but these errors were encountered: