Repository navigation
v0.9.3
Fixed
-
A
strdestination torename()/symlink_to()was re-parsed as a URI,
so part of it was silently discarded. Every scheme resolved the
destination by feeding it back through the URI parser
(Uri(self.parent, target)forrename(),type(self)(target)inside
Path.symlink_to()). That reads a decoded filesystem path as URI
syntax: everything from a?or#onward became a query/fragment and was
dropped,%xxwas percent-decoded, and a relative destination whose first
segment ended in:was read as a scheme. Measured against a real SFTP
server (TrueNAS 26.0.0-BETA.1):call file/link actually produced rename(".../rn?b.txt").../rnrename(".../rn%20b.txt").../rn b.txtsymlink_to(".../cache?v=2")link points at .../cacherename("C:/Temp/x.txt")/Temp/x.txt(C:taken as a scheme)Nothing raised. When something already occupied the truncated name the call
instead failed with a bareOSError: Failure, so the symptom was either
silent misplacement or an unexplained error depending on what happened to
be there. Downstream,pytruenas's documented
client.path(x).symlink_to(y)route created a wrong link, and
PathSyncer'ssymlink_mode="preserve"(which handssymlink_to()the
raw target stringreadlink()returned) mirrored such a link to the wrong
place.A
strdestination is now taken as an already-decoded path —?,#,
%and:are ordinary filename characters — via the new
Uri._from_decoded_path(), one implementation shared by
Uri._rename_target()(used bySftpPath,FtpPath,DavPath,
S3Path,GsPath,AzPathandArchiveUri) and by
UriPath._symlink_target(), an override of a newPath._symlink_target()
hook. Relative destinations keep their existing meaning: arename()
destination is a sibling, asymlink_to()target is stored verbatim and
stays relative. The string is not percent-encoded on the way in, so a
destination that legitimately contains a literal%20— or a path object
built by a consumer that already encoded it — is not encoded twice.
readlink(),unlink(),rmdir()andhardlink_to()never had this
defect.copy()/move()are deliberately unchanged: theirstr
destination is still parsed as a URI, which is what makes a cross-scheme
copy("s3://bucket/key")work. Seedocs/divergences.md.
Full Changelog: v0.9.2...v0.9.3