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

Project import happily assumes a path is in common when it doesn't exist #61

Open
moi90 opened this issue Feb 20, 2023 · 0 comments
Open

Comments

@moi90
Copy link
Contributor

moi90 commented Feb 20, 2023

def unzip_if_needed(self, owner_id: UserIDT) -> str:

If UserDirectory(owner_id) does not contain the file, it is assumed that it is in CommonFolder(self.config.common_folder()).
This leads to the later error message: No object to import.<br>* No .txt or .tsv file was found, of which name starts with 'ecotaxa'. It is not obvious from that message that the supplied path was wrong.

It would be better to validate the path early on.

Also, UserDirectory.contains is a coarse heuristic. Furthermore, this would be the place to fix #56 and #60:

I would let UserDirectory and CommonFolder calculate the absolute path of the supplied filename and check which of both exists (and is below the user or common directory). The only remaining problem would be that a name could exist in both directories, so that the choice is ambiguous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant