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

Fix glob not following symdir directories #9910

Merged
merged 4 commits into from
Dec 1, 2020

Conversation

straight-shoota
Copy link
Member

Fixes #9241

I have no idea why my initial code did explicitly exclude symlinks. It doesn't seem to make sense because everyone else follows symlinks.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:files labels Nov 12, 2020
@bcardiff
Copy link
Member

If there are symlinks to parent folder it will iterate forever. ∞

Python does not traverse by default. https://docs.python.org/3/library/glob.html.

I would do the same:

  • to not follow symlinks by default
  • add a named argument in Dir.glob to follow_symlinks

@straight-shoota straight-shoota added kind:feature and removed kind:bug A bug in the code. Does not apply to documentation, specs, etc. labels Nov 12, 2020
@straight-shoota straight-shoota added this to the 1.0.0 milestone Nov 26, 2020
@bcardiff bcardiff merged commit 1fabed5 into crystal-lang:master Dec 1, 2020
@straight-shoota straight-shoota deleted the fix/glob-symlink branch December 1, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dir.glob doesn't follow symlinks
4 participants