Shahaf Shavit
Shahaf Shavit

Reputation: 3

Unknown type error trying to use the file method on sftp client from Paramiko in Python

I'm using paramiko in Python in order to write files to linux servers. I seem to have errors when writing to a path which includes folders with Hebrew names. After initializing a ssh_client and sftp client on that session, i'm using chmod to get to the folder I want to write to. Then, I'm using the sftp.file method to get a file object to write some content to. It works when I have paths in English. When I have a path that contains Hebrew the method fails.. It fails at the point I'm initializing the file in the sftp session.

The error is Unknown type for u'/root/\u05e9/filename.json' type

Thanks!

Upvotes: 0

Views: 460

Answers (1)

Jack Yang
Jack Yang

Reputation: 309

Judging from the error message "Unknown type", this error is not caused by initialization of the file object in your sftp session, but rather something afterwards has caused the error. It'll be clear if you can post the source code.

Upvotes: 1

Related Questions