Minor fixes

How about `hdfs_path = hdfs_path.rstrip(posixpath.sep)` instead? You wouldn't need the branch.