Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] File-Tree tree_parser error when debugging #63

Open
1 task
JRandy77 opened this issue Jul 19, 2023 · 1 comment
Open
1 task

[BUG] File-Tree tree_parser error when debugging #63

JRandy77 opened this issue Jul 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JRandy77
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

When using relative paths for file_tree specification i.e.

.\trees\bids_raw.tree

Inconsistent crashing occurs in the file_tree internal tree parsing. It sometimes works fine, currently it works fine when I run normally but in debug mode I get the following error. (I have also had the reverse where debug mode works, and normal does not)

Current Behavior

tree = FileTree.read(pars.file_tree_path)
TypeError: unsupported operand type(s) for +: 'WindowsPath' and 'str'

In this following method of code:

def search_tree(name: str) -> Union[Path, str, FileTree]:
    """
    Search for the file defining the specific tree.

    Iteratively searches through the directories in ``tree_directories`` till a file named ${name}.tree is found.
    If not found in ``tree_directories`` the filetrees in installed python packages will be searched.

    :param name: Name of the tree
    :return: string containing the filetree definition
    """
    for directory in tree_directories:
        filename = op.join(directory, name)
        if not filename.endswith(".tree"):
            filename = filename + ".tree"
        if op.exists(filename):
            return Path(filename)

    scan_plugins()

    for ext in (".tree", ""):
        if name + ext in available_subtrees:
            return available_subtrees[name + ext]

    raise ValueError("No file tree found for %s" % name)

Error message

No response

Environment

  • OS:
  • Python/Node version:

How to reproduce

No response

Anything else?

No response

@JRandy77 JRandy77 added the bug Something isn't working label Jul 19, 2023
@JRandy77
Copy link
Collaborator Author

Probably is related to this line of code:

 FileTree.read(cwd / config["Input"]["file_tree_path"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant