Skip to content

Commit

Permalink
Allow relative paths in the filesystem backend (celery#6070)
Browse files Browse the repository at this point in the history
* Allow relative paths in the filesystem backend

* fix order of if statements
  • Loading branch information
watercrossing authored and jeyrce committed Aug 25, 2021
1 parent 3821c49 commit 3a1bd8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions celery/backends/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def __init__(self, url=None, open=open, unlink=os.unlink, sep=os.sep,
def _find_path(self, url):
if not url:
raise ImproperlyConfigured(E_NO_PATH_SET)
if url.startswith('file:///'):
return url[7:]
if url.startswith('file://localhost/'):
return url[16:]
if url.startswith('file://'):
return url[7:]
raise ImproperlyConfigured(E_PATH_NON_CONFORMING_SCHEME)

def _do_directory_test(self, key):
Expand Down

0 comments on commit 3a1bd8f

Please sign in to comment.