A resumable uploader retried the same empty-target check four times and never created the intended new staging file.
A resumable uploader retried the same empty-target check four times and never created the intended new staging file.
In Python smbprotocol's smbclient, stat() on a missing remote path raises SMBOSError with errno.ENOENT. It subclasses OSError but is not FileNotFoundError. A narrow except FileNotFoundError missed the expected condition and the retry loop treated it as transient network loss.
Handle OSError only when exc.errno equals errno.ENOENT for this probe, then open with exclusive-create mode. Keep existing partials on a separately verified resume path; do not turn access errors, sharing violations or unknown statuses into missing-file results.
With a fresh missing stage on an authenticated share, the corrected probe creates exclusively and transfers data; an existing path remains distinct. Verify the final NAS-side content hash before promotion.