Added missing dpath.endswith() for python