WayScience / pyroptosis_signature_image_profiling

This repository contains the pipelines used to analyze the data sets from the Interstellar collaboration.
Creative Commons Zero v1.0 Universal
2 stars 3 forks source link

Add `.resolve()` to all absolute paths to avoid using symlinks #23

Closed jenna-tomkinson closed 1 year ago

jenna-tomkinson commented 1 year ago

This is a suggestion for future development.

The absolute() method call is good, however, if fails to check if the file exists or if it is a symlink file. Therefore, I would suggest using pathlib.Path.resolve(strict=True) as it inherently checks if the file exists, and it gets the true absolute source path (not absolute symlink path)

In addition, it seems that the absolute() is untested at this moment https://github.com/python/cpython/blob/c4a786b8ad2a625594551ab3bc991a6831ba7688/Lib/pathlib.py#L1096-L1112

I would recommend using pathlib.Path.resolve() as it is safer when handling file paths.


_Reply via ReviewNB_

jenna-tomkinson commented 1 year ago

This was implemented in PR #22, so this issue can be closed.