# HG changeset patch # User Ludovic Chabant # Date 1424069266 28800 # Node ID 4dce0e61b48c3dc26a44d2e6b0f21186f83967bc # Parent 879fe1457e48a4d50f22bdd8212ed4c4c9be8b59 internal: Fix bug with the default source when listing `/` path. diff -r 879fe1457e48 -r 4dce0e61b48c piecrust/sources/base.py --- a/piecrust/sources/base.py Sun Feb 15 22:46:23 2015 -0800 +++ b/piecrust/sources/base.py Sun Feb 15 22:47:46 2015 -0800 @@ -376,7 +376,8 @@ return None, None def listPath(self, rel_path): - path = os.path.join(self.fs_endpoint_path, rel_path.lstrip("\\/")) + rel_path = rel_path.lstrip('\\/') + path = os.path.join(self.fs_endpoint_path, rel_path) names = sorted(os.listdir(path)) items = [] for name in names: @@ -396,6 +397,8 @@ self._populateMetadata(fac_path, metadata) fac = PageFactory(self, fac_path, metadata) + + name, _ = os.path.splitext(name) items.append((False, name, fac)) return items