-
Notifications
You must be signed in to change notification settings - Fork 67
Description
I found this when reviewing fox-it/acquire#255. Path.samefile
doesn't function as intended on some of the TargetPath
implementations.
These are my findings as of now using TargetPath.samefile(string_path)
-
python3.9
During thesamefile
call it raises anAttributeError
of it missing a_accessor
property inside theTargetPath
occurs during a
Path.samefile
, it attempts to stat both files. This is theTargetPath
and the stringy path. However, when it attempts to stat theTargetPath
it misses the_accessor
that is used insideTargetPath
*Note*
This is also an issue when usingTargetPath.samefile(TargetPath)
-
python3.10
When callingsamefile
with a string path it attempts to stat the string path withself._accessor.stat('/str/of/path')
. However, in thestat
ofTargetPath
3.10 it assumes the path passed is aTargetPath
object. Then it attempts to use aget
call on the string which doesn't exist -
python3.11
When callingsamefile
on python 3.11 we get the following error:TypeError: invalid PureDissectPath initialization: missing filesystem, got ('/vmfs/volumes/a8904c52-004e297f-9598-eb765dc56934',) (this might be a bug, please report)
In this case samefile attempts to create a new
PureDissectPath
class. During this process it runsPureDissectPath._from_parts
where it expects the first argument to be aFilesystem
but instead it receives the string path, and it crashes.
Didn't find an issue with python 3.12 or python 3.13