{"action":"created","issue":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/304","labels_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/304/comments","events_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/304/events","html_url":"https://github.com/gitpython-developers/GitPython/issues/304","id":91267379,"number":304,"title":".pack and .idx file descriptors left open","user":{"login":"jantman","id":273454,"avatar_url":"https://avatars.githubusercontent.com/u/273454?v=3","gravatar_id":"","url":"https://api.github.com/users/jantman","html_url":"https://github.com/jantman","followers_url":"https://api.github.com/users/jantman/followers","following_url":"https://api.github.com/users/jantman/following{/other_user}","gists_url":"https://api.github.com/users/jantman/gists{/gist_id}","starred_url":"https://api.github.com/users/jantman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jantman/subscriptions","organizations_url":"https://api.github.com/users/jantman/orgs","repos_url":"https://api.github.com/users/jantman/repos","events_url":"https://api.github.com/users/jantman/events{/privacy}","received_events_url":"https://api.github.com/users/jantman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gitpython-developers/GitPython/labels/acknowledged","name":"acknowledged","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/milestones/10","html_url":"https://github.com/gitpython-developers/GitPython/milestones/v1.0.2%20-%20Fixes","labels_url":"https://api.github.com/repos/gitpython-developers/GitPython/milestones/10/labels","id":1078407,"number":10,"title":"v1.0.2 - Fixes","description":"","creator":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":30,"state":"open","created_at":"2015-04-22T07:27:35Z","updated_at":"2015-08-16T17:54:16Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-06-26T14:35:37Z","updated_at":"2015-08-18T18:42:57Z","closed_at":null,"body":"Sorry, but I believe I found another issue. It appears (maybe I'm missing something here, because this seems very strange to me) that file descriptors are left open after the Repo object is unused or destroyed.\r\n\r\n```\r\n(foo)jantman@jarvis:pts/8:~/tmp/foo$ cat test.py\r\n#!/usr/bin/env python\r\n\r\nimport git\r\nimport commands\r\nimport os\r\nimport time\r\n\r\npid = os.getpid()\r\n\r\ndef show_lsof():\r\n    global pid\r\n    cmd = \"lsof -p {p} | grep -v /usr/lib\".format(p=pid)\r\n    print(\"=============================\")\r\n    print(\"running {c}:\".format(c=cmd))\r\n    print(commands.getoutput(cmd))\r\n    print(\"=============================\")\r\n\r\nfor rname in ['testrepo', 'testrepo2', 'testrepo3']:\r\n    print(\"=> Creating repo object for {rname}:\".format(rname=rname))\r\n    r = git.Repo(rname)\r\n    show_lsof()\r\n\r\n    print(\"=> iterating commits\")\r\n    for c in r.iter_commits():\r\n        pass\r\n    show_lsof()\r\n\r\n    time.sleep(2)\r\n    print(\"=> del r\")\r\n    del r\r\n    time.sleep(2)\r\n\r\n    show_lsof()\r\n(foo)jantman@jarvis:pts/8:~/tmp/foo$ ./test.py  \r\n=> Creating repo object for testrepo:\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  88651 pipe\r\n=============================\r\n=> iterating commits\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  91431 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> del r\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  91434 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> Creating repo object for testrepo2:\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  91435 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> iterating commits\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  87601 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    6r   REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    7r   REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> del r\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  90605 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    6r   REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    7r   REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> Creating repo object for testrepo3:\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  87612 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    6r   REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    7r   REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> iterating commits\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  79855 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  79854 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  87616 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    6r   REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    7r   REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    8r   REG   0,30    42220  79854 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    9r   REG   0,30     3032  79855 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n=> del r\r\n=============================\r\nrunning lsof -p 5325 | grep -v /usr/lib:\r\nCOMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME\r\npython  5325 jantman  cwd    DIR   0,30      200  73513 /tmp/jantman/foo\r\npython  5325 jantman  rtd    DIR    8,5     4096      2 /\r\npython  5325 jantman  txt    REG   0,30     6240  73547 /tmp/jantman/foo/bin/python2\r\npython  5325 jantman  mem    REG   0,30    33020  73600 /tmp/jantman/foo/lib/python2.7/site-packages/gitdb/_perf.so\r\npython  5325 jantman  mem    REG   0,30     3032  79855 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  79854 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman  mem    REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman  mem    REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    0u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    1u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    2u   CHR  136,8      0t0     11 /dev/pts/8\r\npython  5325 jantman    3r  FIFO    0,8      0t0  88654 pipe\r\npython  5325 jantman    4r   REG   0,30    42220  83920 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    5r   REG   0,30     3032  83921 /tmp/jantman/foo/testrepo/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    6r   REG   0,30    42220  89333 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    7r   REG   0,30     3032  89334 /tmp/jantman/foo/testrepo2/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\npython  5325 jantman    8r   REG   0,30    42220  79854 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.pack\r\npython  5325 jantman    9r   REG   0,30     3032  79855 /tmp/jantman/foo/testrepo3/.git/objects/pack/pack-bfea6cfc8edeb84afcc3c9f4d36ce56ed8945db3.idx\r\n=============================\r\n```\r\n\r\nThe same thing happens if I explicitly ``r = None``. This is a real problem for me, as I'm trying to write an analysis script that looks at commits in about 450 repositories. On Linux with a default open file handle limit of 1024, the script ends up crashing as *every* repository I examine results in open file handles for the pack and index files, that appear to never be cleaned up.\r\n\r\nI feel like I *have* to be doing something wrong here, as I don't understand why these aren't cleaned up even after I'm done using the Repo object, and I set it to ``None`` or ``del`` it."},"comment":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/comments/132314002","html_url":"https://github.com/gitpython-developers/GitPython/issues/304#issuecomment-132314002","issue_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/304","id":132314002,"user":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T18:42:57Z","updated_at":"2015-08-18T18:42:57Z","body":"Thank you for posting your findings !\r\nAlso I am very sorry to hear you spent so much time on this ... really ... nobody should have to do that as the code was built with the false premises of having working (i.e. deterministic) destructors :( !\r\n\r\nAlso I hope you are aware of the fix using the `GitCmdObjectDB` as `odbt` when instantiating `Repo` objects - this solved the problem for *jantman*, and is the only workaround I know."}}