{"action":"opened","issue":{"url":"https://api.github.com/repos/joblib/joblib/issues/200","labels_url":"https://api.github.com/repos/joblib/joblib/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/joblib/joblib/issues/200/comments","events_url":"https://api.github.com/repos/joblib/joblib/issues/200/events","html_url":"https://github.com/joblib/joblib/issues/200","id":65213949,"number":200,"title":"Memory.clear() exception when cachedir=None ","user":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-30T13:35:31Z","updated_at":"2015-03-30T13:35:31Z","closed_at":null,"body":"[note: I hit this on 0.8.4, but I suspect it affects earlier versions as well.]\r\n\r\nCreating a dummy Memory object (using `cachedir=None`) isn't as transparent as it could be.  Trying to clear the cache causes a `TypeError`:\r\n```python\r\nIn [1]: import joblib\r\n\r\nIn [2]: M = joblib.Memory(cachedir=None)\r\n\r\nIn [3]: M.clear()\r\nWARNING:root:[Memory(cachedir=None)]: Flushing completely the cache\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-3-f5283b9ae328> in <module>()\r\n----> 1 M.clear()\r\n\r\n/usr/local/lib/python2.7/dist-packages/joblib/memory.pyc in clear(self, warn)\r\n    880         if warn:\r\n    881             self.warn('Flushing completely the cache')\r\n--> 882         rm_subdirs(self.cachedir)\r\n    883 \r\n    884     def eval(self, func, *args, **kwargs):\r\n\r\n/usr/local/lib/python2.7/dist-packages/joblib/disk.pyc in rm_subdirs(path, onerror)\r\n     81     names = []\r\n     82     try:\r\n---> 83         names = os.listdir(path)\r\n     84     except os.error as err:\r\n     85         if onerror is not None:\r\n\r\nTypeError: coercing to Unicode: need string or buffer, NoneType found\r\n```\r\n\r\nI would expect `clear()` on a dummy Memory object to be a silent no-op, so this seems like a bug."}}