Repository navigation
Changed
tftp.pathis built onpathapianduripath. Thepathextra installs
pathapi>=0.1.0,<0.2andpathapi-uri>=0.1.0,<0.2where it installedpathlib-next[uri],
which cannot be installed beside them. To upgrade, importLocalPath,MemPathandFileStat
frompathapiinstead ofpathlib_next, and spell the URI path
from uripath import URIPath; URIPath("tftp://host/file")where it was
pathlib_next.uri.UriPath.TFTPPathandTFTPURIPathkeep their names, arguments and
methods, andURIPath("tftp://...")findsTFTPURIPathwithout an import, now through the
uripath.schemesentry-point group.unlink()always raisesNotImplementedError.unlink(missing_ok=True)used to return
without doing anything, so thatcopy(overwrite=True)could clear its target.pathapino
longer asks a target that cannot be removed to do that, and the write that follows still replaces
the file, so a caller ofcopy()changes nothing. A program that calledunlink(missing_ok=True)
itself must stop, or askpathapi.protocols.supports(path, Remove)first.move()from a TFTP path raisesNotImplementedErrorbefore it copies anything. It used to
copy the file and then raise because the source could not be deleted, which left a stray copy at
the destination. Checksupports(path, Remove)to know in advance.stat()says when the server gave no size. A server that does not sendtsize(and a file
longer than one block) used to givest_size == 0as if it were known; the result now has
size_known == False, andst_sizeis still 0. A caller that needs the size reads the file or
uses a server that reports it.
Added
pathapi.protocols.supports(path, Listing)answers for the server: onex-listprobe of its root
on the first question, kept for the life of the client,Falsefor a server without the
extension. The classes implementStat,BinaryOpen,Listing,IdentityandCopy, and
capabilities()of either says so.
Fixed
- A failed or abandoned upload no longer replaces the server's file. A
withblock over
open("w")that raised, a text write that could not be encoded (write_text("\u00e9", encoding="ascii")) and a file collected unclosed all uploaded what had been written, even an
empty file. Each now sends nothing and the server keeps the file it had; a stream collected
unclosed emits oneResourceWarning. Closing a stream normally still uploads.
Full Changelog: v0.1.1...v0.2.0