Ubuntu encrypted home directory | Errno 36 File Name too long

自古美人都是妖i 提交于 2019-12-06 06:10:17

The fact that the filename that's too long starts with '.cache/www.example.com' explains the problem.

httplib2 optionally caches requests that you make. You've enabled caching, and you've given it .cache as the cache directory.

The easy solution is to put the cache directory somewhere else.

Without seeing your code, it's impossible to tell you how to fix it. But it should be trivial. The documentation for FileCache shows that it takes a dir_name as the first parameter.

Or, alternatively, you can pass a safe function that lets you generate a filename from the URI, overriding the default. That would allow you to generate filenames that fit within the 144-character limit for Ubuntu encrypted fs.

Or, alternatively, you can create your own object with the same interface as FileCache and pass that to the Http object to use as a cache. For example, you could use tempfile to create random filenames, and store a mapping of URLs to filenames in an anydbm or sqlite3 database.

A final alternative is to just turn off caching, of course.

You are probably hitting limitation of the encrypted file system, which allows up to 143 chars in file name.

Here is the bug: https://bugs.launchpad.net/ecryptfs/+bug/344878

The solution for now is to use any other directory outside your encrypted home directory. To double check this:

mount | grep ecryptfs

and see if your home dir is listed. If that's the case either use some other dir above home, or create a new home directory without using encryption.

As you apparently have passed '.cache' to the httplib.Http constructor, you should change this to something more appropriate or disable the cache.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!