Glob pattern does not work #31

vrischmann opened this Issue Nov 28, 2012 · 3 comments


None yet

2 participants


I have a bundle defined like this:

bootstrap_js = Bundle(

Since a few days ago (I guess with the new release) the glob is not working, instead of having multiple URLs I get one to "http://localhost:8080/static/libs/bootstrap/js/*.js"

After a quick look in the source code I didn't find an easy fix, but I think it's got something to do with the method FlaskResolver.resolve_source_to_url.

Also, I did a git bisect and it told me the first bad commit is 3d9913f

I'd be happy to provide more info if you want.


The problem should be in the search_for_source method:

If you could set a breakpoint there and figure out why the incoming item with the pattern is not resolved to a list of multiple files, that would be helpful. What I would expect to happen, from reading the code, is that in line 179, the consider_single_directory call should resolve the glob pattern.


Ok, I'm not sure what I'm doing wrong with pdb and the breakpoint, but when I define a breakpoint with b it never breaks.

I used a print instead, and consider_single_directory resolves correctly, I get a list of files.

I did somme digging, in the method resolve_source_to_url, I printed the filename variable at and it prints "libs/bootstrap/js/*.js".

Going higher up, I think there's a problem with the method resolve_contents in webassets's file, at

The item variable used here is never going to be expanded to the correct path, and the resolve_source_to_url method in FlaskResolver uses this as a filename to get the URL.

@pistolero pistolero pushed a commit to pistolero/flask-assets that referenced this issue Jan 3, 2013
@gvmh gvmh Fixed glob patterns (issue #31) 265b1b1

Fixed via #32.

@miracle2k miracle2k closed this Jan 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment