Why does Python give “OSError: [Errno 36] File name too long” for filename shorter than filesystem's limit?

前端 未结 1 1598
忘掉有多难
忘掉有多难 2021-01-02 06:53

The following code yields an unexpected exception:

open(\"52bbe674cdc81d4140099b84fa69eea4249bcceee75bcbe4838d911ab076547cfdad3c1c5197752a98e5525fe76613dbe52         


        
1条回答
  •  -上瘾入骨i
    2021-01-02 07:45

    I've found a solution. It turns out that I'm not dealing with pure ext4---it's actually ecryptfs layered atop ext4, carried over from a previous Ubuntu install. As suggested in an unaccepted answer to this related question the ecryptfs layer imposes a limit of 143 characters to the filename length. A definitive answer to the file name length limit under ecryptfs can be found here.

    0 讨论(0)
提交回复
热议问题