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)
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 usingpathlib.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-L1112I would recommend using
pathlib.Path.resolve()
as it is safer when handling file paths._Reply via ReviewNB_
_Originally posted by @axiomcura in https://github.com/WayScience/pyroptosis_signature/pull/22#discussion_r1156148979_