Skip to content

--tmp ignored by kb ref #122

@skafdasschaf

Description

@skafdasschaf

Dear kb_python team,

I believe that kb ref ignores the --tmp argument, i.e., the user is actually unable to select a custom temporary directory.

Reason: The relevant code in main.py is

temp_dir = args.tmp or os.path.join(
    args.o, TEMP_DIR
) if 'o' in args else TEMP_DIR

Since -o is only available for kb count, the if statement always evaluates to False in kb ref, and the value of the else clause (TEMP_DIR) is used.

Solution: I think it will suffice if you add the following parentheses to change operator precedence:

temp_dir = args.tmp or (os.path.join(
    args.o, TEMP_DIR
) if 'o' in args else TEMP_DIR)

cheers,
Wolfgang

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions