ioflo / hio

Apache License 2.0
8 stars 8 forks source link

Fix os.path.join when joins include absolute paths #27

Closed SmithSamuelM closed 1 month ago

SmithSamuelM commented 1 year ago

I think the safest thing to do is to call os.path.isabs(path) iabs on the to be joined path and if True reject and return an error. This is safer than checking for “/” or any file system dependent character. The docs for join state that if any of the to be joined paths is an absolute path then the join restarts with that path. That really seems like a bad idea should raise an error.. So everywhere I call join I need to do the path.isabs() check to ensure don’t get this unexected behavior