hdfs3 icon indicating copy to clipboard operation
hdfs3 copied to clipboard

Incorrect Glob pattern behavior

Open geoffowens opened this issue 9 years ago • 1 comments

The glob() function, at core.py:321 doesn't define the correct behavior for the ? wildcard: it replaces it in the regex with ., which will match /, which glob pattern wildcards should never match. pattern = re.compile("^" + path.replace('//', '/') .rstrip('/') .replace('*', '[^/]*') .replace('?', '.') + "$") I believe changing that line to .replace('?', '[^/]') would fix this issue.

geoffowens avatar Jul 14 '16 19:07 geoffowens

Is this a change that you would be interested in implementing?

On Thu, Jul 14, 2016 at 2:21 PM, geoffowens [email protected] wrote:

The glob() function, at core.py:321 doesn't define the correct behavior for the ? wildcard: it replaces it in the regex with ., which will match /, which glob pattern wildcards should never match. http://man7.org/linux/man-pages/man7/glob.7.html pattern = re.compile("^" + path.replace('//', '/') .rstrip('/') .replace('', '[^/]') .replace('?', '.') + "$") I believe changing that line to .replace('?', '[^/]') would fix this issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dask/hdfs3/issues/87, or mute the thread https://github.com/notifications/unsubscribe/AASszD4xZEFsi8awSeP-YVDVn5PNsHa_ks5qVow7gaJpZM4JMwxi .

mrocklin avatar Jul 15 '16 14:07 mrocklin