{"action":"created","issue":{"url":"https://api.github.com/repos/wummel/patool/issues/16","labels_url":"https://api.github.com/repos/wummel/patool/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/wummel/patool/issues/16/comments","events_url":"https://api.github.com/repos/wummel/patool/issues/16/events","html_url":"https://github.com/wummel/patool/issues/16","id":44710398,"number":16,"title":"Means of programmatically overwriting pre-existing files?","user":{"login":"abelsonlive","id":1621721,"avatar_url":"https://avatars.githubusercontent.com/u/1621721?v=3","gravatar_id":"","url":"https://api.github.com/users/abelsonlive","html_url":"https://github.com/abelsonlive","followers_url":"https://api.github.com/users/abelsonlive/followers","following_url":"https://api.github.com/users/abelsonlive/following{/other_user}","gists_url":"https://api.github.com/users/abelsonlive/gists{/gist_id}","starred_url":"https://api.github.com/users/abelsonlive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abelsonlive/subscriptions","organizations_url":"https://api.github.com/users/abelsonlive/orgs","repos_url":"https://api.github.com/users/abelsonlive/repos","events_url":"https://api.github.com/users/abelsonlive/events{/privacy}","received_events_url":"https://api.github.com/users/abelsonlive/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wummel/patool/labels/fixed","name":"fixed","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-10-02T16:53:50Z","updated_at":"2015-12-07T11:33:23Z","closed_at":"2015-12-07T11:33:23Z","body":"Hi,\r\n\r\nI'm using `patool` to programmatically unarchive a variety of archivables by calling it via `subprocess` in python.  Here's my basic code:\r\n\r\n```python\r\ndef unarchive(file_path, file_dir):\r\n  \"\"\"\r\n  Use patool for universal extraction.\r\n  \"\"\"\r\n  args = ['patool', 'extract', file_path, '--outdir', file_dir]\r\n  p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\r\n  (out, err) = p.communicate()\r\n  return out, err\r\n```\r\n\r\nHowever, in some cases if there are duplicate files in an archive, `patool` will ask for user input as how to proceed:\r\n```bash\r\nEO-926055986-N81-2014/CAT. No. EO-926055986-N81-2014       14-PL-0179.xlsx already exists. Overwrite it ?\r\n[Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit A\r\n```\r\n\r\nUnfortunately, this means that the `subprocess` just hangs without proceeding and `p.communicate()` never completes.  I was hoping there might be a way to add a command line flag to pass in a default response to this prompt (somewhat like `-y` for `sudo apt-get install`).  \r\n"},"comment":{"url":"https://api.github.com/repos/wummel/patool/issues/comments/162496605","html_url":"https://github.com/wummel/patool/issues/16#issuecomment-162496605","issue_url":"https://api.github.com/repos/wummel/patool/issues/16","id":162496605,"user":{"login":"wummel","id":1279658,"avatar_url":"https://avatars.githubusercontent.com/u/1279658?v=3","gravatar_id":"","url":"https://api.github.com/users/wummel","html_url":"https://github.com/wummel","followers_url":"https://api.github.com/users/wummel/followers","following_url":"https://api.github.com/users/wummel/following{/other_user}","gists_url":"https://api.github.com/users/wummel/gists{/gist_id}","starred_url":"https://api.github.com/users/wummel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wummel/subscriptions","organizations_url":"https://api.github.com/users/wummel/orgs","repos_url":"https://api.github.com/users/wummel/repos","events_url":"https://api.github.com/users/wummel/events{/privacy}","received_events_url":"https://api.github.com/users/wummel/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T11:33:22Z","updated_at":"2015-12-07T11:33:22Z","body":"A new version 1.9 of patool has been released on 07.12.2015.\nTherefore this bug will be closed. If you think this issue is not solved, please open a new issue."}}