Friday, March 23, 2018

Python: OSError: [Errno 36] File name too long

在Python寫檔案的檔案名稱原來有長度限制,不能超過143個字符,否則就會出現錯誤。應該沒有解決方案,在寫檔案的時候小心吧。
OSError: [Errno 36] File name too long: '......'

# truncate filename if length > 100 (100 + 32 (md5) = 132 < 143 (crash limit). Later .desc is added to filename, so better 100 as max)

Reference: IOError: [Errno 36] File name too long

No comments: