Skip to content

BUG: Filepaths with square brackets, [ ], are ignored/errored #94

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

Closed
MarcG2 opened this issue Feb 21, 2024 · 4 comments
Closed

BUG: Filepaths with square brackets, [ ], are ignored/errored #94

MarcG2 opened this issue Feb 21, 2024 · 4 comments
Labels
bug : non-critical A bug was found in difPy, but it is not critical to the functioning of the package. status : implemented Feature was implemented in difPy.

Comments

@MarcG2
Copy link

MarcG2 commented Feb 21, 2024

I discovered another odd bug. If I have files located in a folder that contains square brackets in the name, difPy ends up ignoring those files. If the file name contains brackets, there doesn't seem to be a problem.

I'm using the CLI version on Windows in case that makes a difference.

EDIT:
This is in regards v4.0.1. I haven't tried 4.1 which I noticed just came out.

@elisemercury
Copy link
Owner

Hi @MarcG2,

Thanks for reaching out! Please try the new version difPy v4.1.0 as it comes with some improvements around the algorithm.
Feel free to reach out if the issue still persists.

Best,
Elise

@elisemercury elisemercury added bug : non-critical A bug was found in difPy, but it is not critical to the functioning of the package. question Further information is requested. and removed bug : non-critical A bug was found in difPy, but it is not critical to the functioning of the package. labels Feb 21, 2024
@MarcG2
Copy link
Author

MarcG2 commented Feb 27, 2024

I tested out the new version. The bug is still there. An example file path that gives that's a problem is

D:\Pictures[2024] Images\img1.png

If there's only one bracket as shown here, difpy works like normal

D:\Pictures[2024 Images\img1.png

So it appears to be a parsing issue. To replicate, simply create a folder with a bracket pair in its name and add 2 copies of the same image.

@MarcG2
Copy link
Author

MarcG2 commented Jun 6, 2024

I believe I know what's causing this problem. It's because difPy uses the glob library. Which employs unix style file path matching.

I recently encountered another app that failed on paths with square brackets for this exact reason. I haven't tested it yet, but square brackets need to be escaped.

If you don't want to implement a fix, I highly encourage you to at least update the documentation regarding this. Almost no Windows user are going to familiar with unix style pattern matching.

@elisemercury elisemercury added bug : non-critical A bug was found in difPy, but it is not critical to the functioning of the package. status : in progress Feature is currently being implemented in difPy. and removed question Further information is requested. labels Nov 15, 2024
elisemercury added a commit that referenced this issue Nov 15, 2024
* Added error handling for a bug that would cause difPy not to import files and folders with brackets in their filepaths
@elisemercury
Copy link
Owner

Hi @MarcG2,

I was finally able to reproduce your issue. The issue would happen when a folder would have a bracket in the file path, and in_folder would be set to True. Thanks again for noticing and opening the issue.

The issue has now been fixed with version 4.1.2. Let me know if this fixes the issue on your side too.

Thanks again,
Elise

@elisemercury elisemercury added status : implemented Feature was implemented in difPy. and removed status : in progress Feature is currently being implemented in difPy. labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug : non-critical A bug was found in difPy, but it is not critical to the functioning of the package. status : implemented Feature was implemented in difPy.
Projects
None yet
Development

No branches or pull requests

2 participants