diff --git a/contrib/buildbot/phabricator_wrapper.py b/contrib/buildbot/phabricator_wrapper.py --- a/contrib/buildbot/phabricator_wrapper.py +++ b/contrib/buildbot/phabricator_wrapper.py @@ -389,8 +389,12 @@ # Use a Diffusion browsequery on the parent directory because the # API will fail if a filename is given. If path is not set the root # directory is browsed. + # Since https://secure.phabricator.com/D21519 the browsequery endpoint + # will return an empty result if the trailing slash is missing from the + # searched path. There is an exception for the root directory for which + # the '/' path is invalid and will throw an error. browse_data = self.diffusion.browsequery( - path=os.path.dirname(path) or None, + path=os.path.join(os.path.dirname(path), '') or None, commit=latest_commit_hash, repository=BITCOIN_ABC_REPO, branch="master", diff --git a/contrib/buildbot/test/test_phabricator.py b/contrib/buildbot/test/test_phabricator.py --- a/contrib/buildbot/test/test_phabricator.py +++ b/contrib/buildbot/test/test_phabricator.py @@ -261,7 +261,7 @@ def test_get_file_content_from_master(self): commit_hash = "0000000000000000000000000000000123456789" file_phid = "PHID-FILE-somefile" - path = "some/file" + path = "some/file/" self.phab.get_latest_master_commit_hash = mock.Mock() self.phab.get_latest_master_commit_hash.return_value = commit_hash