{"action":"opened","number":31,"pull_request":{"url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31","id":33424571,"html_url":"https://github.com/4teamwork/ftw.zipexport/pull/31","diff_url":"https://github.com/4teamwork/ftw.zipexport/pull/31.diff","patch_url":"https://github.com/4teamwork/ftw.zipexport/pull/31.patch","issue_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/31","number":31,"state":"open","locked":false,"title":"Added check if fs has enough space to create the zip file.","user":{"login":"shylux","id":1375745,"avatar_url":"https://avatars.githubusercontent.com/u/1375745?v=3","gravatar_id":"","url":"https://api.github.com/users/shylux","html_url":"https://github.com/shylux","followers_url":"https://api.github.com/users/shylux/followers","following_url":"https://api.github.com/users/shylux/following{/other_user}","gists_url":"https://api.github.com/users/shylux/gists{/gist_id}","starred_url":"https://api.github.com/users/shylux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shylux/subscriptions","organizations_url":"https://api.github.com/users/shylux/orgs","repos_url":"https://api.github.com/users/shylux/repos","events_url":"https://api.github.com/users/shylux/events{/privacy}","received_events_url":"https://api.github.com/users/shylux/received_events","type":"User","site_admin":false},"body":"This PR adds a check to ensure that a zip file doesn't exceed the disk space. The check checks every time before adding a file to the zip if the new file is bigger than the available space on the current disk partition.\r\n\r\nWhat happens if the disk is full? \r\nAn error is raised and displayed to the user. Since the zip is opened inside a context manager it automatically deletes the file.\r\n\r\nHow long does the zip file life on the FS?\r\nThe zip file is created at the start of the process. `NamedTemporaryFile` is used with the context manager. The files to zip are then one by one added to the zip. Every iteration checks if there is enough free space on the disk. Once the zip is fully assembled it is passed to the download thread. This exits the context manager and the file is marked as deleted by the os (checked with `ls`). But since the download process still has an open file descriptor the file still exists. Is is probably deleted as soon as the download finishes.\r\n\r\n@jone ","created_at":"2015-04-16T07:18:13Z","updated_at":"2015-04-16T07:18:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31/commits","review_comments_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31/comments","review_comment_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/31/comments","statuses_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/statuses/a10abea258b98cbd6b46e7ea29fe7b01622832e5","head":{"label":"4teamwork:lk_check_disk_space","ref":"lk_check_disk_space","sha":"a10abea258b98cbd6b46e7ea29fe7b01622832e5","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":12273078,"name":"ftw.zipexport","full_name":"4teamwork/ftw.zipexport","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/ftw.zipexport","description":"Zip Export for Plone","fork":false,"url":"https://api.github.com/repos/4teamwork/ftw.zipexport","forks_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/forks","keys_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/teams","hooks_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/events","assignees_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/tags","blobs_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/languages","stargazers_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/subscription","commits_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/merges","archive_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/downloads","issues_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/releases{/id}","created_at":"2013-08-21T15:00:00Z","updated_at":"2015-03-25T11:13:21Z","pushed_at":"2015-04-16T07:18:14Z","git_url":"git://github.com/4teamwork/ftw.zipexport.git","ssh_url":"git@github.com:4teamwork/ftw.zipexport.git","clone_url":"https://github.com/4teamwork/ftw.zipexport.git","svn_url":"https://github.com/4teamwork/ftw.zipexport","homepage":null,"size":652,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"4teamwork:master","ref":"master","sha":"8d550eda3714fb85a3d82646c72f223ff562d3da","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":12273078,"name":"ftw.zipexport","full_name":"4teamwork/ftw.zipexport","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/ftw.zipexport","description":"Zip Export for Plone","fork":false,"url":"https://api.github.com/repos/4teamwork/ftw.zipexport","forks_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/forks","keys_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/teams","hooks_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/events","assignees_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/tags","blobs_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/languages","stargazers_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/subscription","commits_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/merges","archive_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/downloads","issues_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/ftw.zipexport/releases{/id}","created_at":"2013-08-21T15:00:00Z","updated_at":"2015-03-25T11:13:21Z","pushed_at":"2015-04-16T07:18:14Z","git_url":"git://github.com/4teamwork/ftw.zipexport.git","ssh_url":"git@github.com:4teamwork/ftw.zipexport.git","clone_url":"https://github.com/4teamwork/ftw.zipexport.git","svn_url":"https://github.com/4teamwork/ftw.zipexport","homepage":null,"size":652,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31"},"html":{"href":"https://github.com/4teamwork/ftw.zipexport/pull/31"},"issue":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/31"},"comments":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/4teamwork/ftw.zipexport/statuses/a10abea258b98cbd6b46e7ea29fe7b01622832e5"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":66,"deletions":15,"changed_files":6}}