well, no experience with paramiko, but only by reading the docs, I would say always include the filename to avoid errors:
I would say you were just lucky not getting error on previous occasion
Quote:remotepath (str) – the destination path on the SFTP server. Note that the filename should be included. Only specifying a directory may result in an error.
I would say you were just lucky not getting error on previous occasion