Revert "path_to_location: fix case when a string location is passed"

This reverts commit f918426228aa15a962615dce3527e416ca60458f.