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

Use normalized URI for glob #6427

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

headius
Copy link
Member

@headius headius commented Oct 6, 2020

The Dir.glob logic did not use the normalized URI form when calling glob internals, and since those internals do not support "classpath:" it ended up raising an IllegalArgumentException as reported in #6421.

This change should be benign, but my concern lies in having to call "getAbsolutePath" to get the normalized URI back.

This may be worth including in 9.2.14.

The createResource call here normalizes a URI like "classpath:" to
our preferred "uri:classloader:" but only uses that normalized
version to check the existence of the resource in question. If the
resource exists, it proceeds to use the un-normalized version in
glob, and fails since "classpath:" is not supported by our glob
internals.

This patch uses the newly normalized path when calling glob
internals, so "classpath:" never leaks into that code.

Fixes jruby#6421
Not directly related to jruby#6421 but found along the way.
@headius headius added this to the JRuby 9.2.14.0 milestone Oct 6, 2020
@headius headius linked an issue Oct 6, 2020 that may be closed by this pull request
@headius
Copy link
Member Author

headius commented Oct 7, 2020

Clearly this needs another look.

@headius headius modified the milestones: JRuby 9.2.14.0, JRuby 9.3.0.0 Oct 7, 2020
@headius headius modified the milestones: JRuby 9.3.0.0, JRuby 9.3.1.0 Aug 2, 2021
@headius headius modified the milestones: JRuby 9.3.1.0, JRuby 9.3.2.0 Oct 13, 2021
@headius headius removed this from the JRuby 9.3.2.0 milestone Dec 2, 2021
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

Successfully merging this pull request may close these issues.

Dir.glob with classpath: resource as a base is broken
1 participant