{"action":"created","comment":{"url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/comments/38349859","id":38349859,"diff_hunk":"@@ -46,6 +47,7 @@\n \n TEX_TEMP = tempfile.gettempdir()\n TEX_EXT  = '.tex'\n+devnull_sentinel = object()","path":"esp/esp/web/util/latex.py","position":null,"original_position":16,"commit_id":"11fa30ef6359ad62423ea378de4e783c7b6761e4","original_commit_id":"c42bd1b918ef72171e95e53c1c40fbf4e3704d84","user":{"login":"jmoldow","id":1150978,"avatar_url":"https://avatars.githubusercontent.com/u/1150978?v=3","gravatar_id":"","url":"https://api.github.com/users/jmoldow","html_url":"https://github.com/jmoldow","followers_url":"https://api.github.com/users/jmoldow/followers","following_url":"https://api.github.com/users/jmoldow/following{/other_user}","gists_url":"https://api.github.com/users/jmoldow/gists{/gist_id}","starred_url":"https://api.github.com/users/jmoldow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmoldow/subscriptions","organizations_url":"https://api.github.com/users/jmoldow/orgs","repos_url":"https://api.github.com/users/jmoldow/repos","events_url":"https://api.github.com/users/jmoldow/events{/privacy}","received_events_url":"https://api.github.com/users/jmoldow/received_events","type":"User","site_admin":false},"body":"Made it private. If a caller wants to, say, have ``stdout`` go to a file but ``stderr`` go to ``devnull``, the caller should explicitly open a handle to ``devnull``, pass that for ``stderr``, and ensure proper file closing, rather than use the sentinel.","created_at":"2015-08-31T19:34:49Z","updated_at":"2015-08-31T19:34:49Z","html_url":"https://github.com/learning-unlimited/ESP-Website/pull/1759#discussion_r38349859","pull_request_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759","_links":{"self":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/comments/38349859"},"html":{"href":"https://github.com/learning-unlimited/ESP-Website/pull/1759#discussion_r38349859"},"pull_request":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759"}}},"pull_request":{"url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759","id":43257636,"html_url":"https://github.com/learning-unlimited/ESP-Website/pull/1759","diff_url":"https://github.com/learning-unlimited/ESP-Website/pull/1759.diff","patch_url":"https://github.com/learning-unlimited/ESP-Website/pull/1759.patch","issue_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1759","number":1759,"state":"open","locked":false,"title":"Remove use of subprocess.PIPE in gen_latex()","user":{"login":"jmoldow","id":1150978,"avatar_url":"https://avatars.githubusercontent.com/u/1150978?v=3","gravatar_id":"","url":"https://api.github.com/users/jmoldow","html_url":"https://github.com/jmoldow","followers_url":"https://api.github.com/users/jmoldow/followers","following_url":"https://api.github.com/users/jmoldow/following{/other_user}","gists_url":"https://api.github.com/users/jmoldow/gists{/gist_id}","starred_url":"https://api.github.com/users/jmoldow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmoldow/subscriptions","organizations_url":"https://api.github.com/users/jmoldow/orgs","repos_url":"https://api.github.com/users/jmoldow/repos","events_url":"https://api.github.com/users/jmoldow/events{/privacy}","received_events_url":"https://api.github.com/users/jmoldow/received_events","type":"User","site_admin":false},"body":"`stdout=PIPE` was used as a shortcut to hide the output of latex generation. However, according to the documentation for `subprocess.call()` [1], this is unsafe, as \"that can deadlock based on the child process output volume\".\r\n\r\nThis explains some of the symptomps of #1198. Namely, a hanging pdflatex process, for what should normally be a <10 second operation.\r\n\r\nInstead, the default arguments to `gen_latex()` now open a file handle to `os.devnull`, and pass that to `subprocess.call()`.\r\n\r\nFixes, either partially or entirely, #1198 (depending on whether database deadlocks from accounting are still an issue).\r\n\r\n[1] <https://docs.python.org/2/library/subprocess.html#subprocess.call>","created_at":"2015-08-25T07:33:09Z","updated_at":"2015-08-31T19:34:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1902fd5a9178b1ff07d46680836bb9a2ff658ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759/commits","review_comments_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759/comments","review_comment_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1759/comments","statuses_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/statuses/11fa30ef6359ad62423ea378de4e783c7b6761e4","head":{"label":"learning-unlimited:latex-subprocess-pipe","ref":"latex-subprocess-pipe","sha":"11fa30ef6359ad62423ea378de4e783c7b6761e4","user":{"login":"learning-unlimited","id":1150905,"avatar_url":"https://avatars.githubusercontent.com/u/1150905?v=3","gravatar_id":"","url":"https://api.github.com/users/learning-unlimited","html_url":"https://github.com/learning-unlimited","followers_url":"https://api.github.com/users/learning-unlimited/followers","following_url":"https://api.github.com/users/learning-unlimited/following{/other_user}","gists_url":"https://api.github.com/users/learning-unlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/learning-unlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learning-unlimited/subscriptions","organizations_url":"https://api.github.com/users/learning-unlimited/orgs","repos_url":"https://api.github.com/users/learning-unlimited/repos","events_url":"https://api.github.com/users/learning-unlimited/events{/privacy}","received_events_url":"https://api.github.com/users/learning-unlimited/received_events","type":"Organization","site_admin":false},"repo":{"id":2643878,"name":"ESP-Website","full_name":"learning-unlimited/ESP-Website","owner":{"login":"learning-unlimited","id":1150905,"avatar_url":"https://avatars.githubusercontent.com/u/1150905?v=3","gravatar_id":"","url":"https://api.github.com/users/learning-unlimited","html_url":"https://github.com/learning-unlimited","followers_url":"https://api.github.com/users/learning-unlimited/followers","following_url":"https://api.github.com/users/learning-unlimited/following{/other_user}","gists_url":"https://api.github.com/users/learning-unlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/learning-unlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learning-unlimited/subscriptions","organizations_url":"https://api.github.com/users/learning-unlimited/orgs","repos_url":"https://api.github.com/users/learning-unlimited/repos","events_url":"https://api.github.com/users/learning-unlimited/events{/privacy}","received_events_url":"https://api.github.com/users/learning-unlimited/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learning-unlimited/ESP-Website","description":"A website to help manage the logistics of large short-term educational programs","fork":false,"url":"https://api.github.com/repos/learning-unlimited/ESP-Website","forks_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/forks","keys_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/teams","hooks_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/hooks","issue_events_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/events{/number}","events_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/events","assignees_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/assignees{/user}","branches_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/branches{/branch}","tags_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/tags","blobs_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/refs{/sha}","trees_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/statuses/{sha}","languages_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/languages","stargazers_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/stargazers","contributors_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/contributors","subscribers_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/subscribers","subscription_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/subscription","commits_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/commits{/sha}","git_commits_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/commits{/sha}","comments_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/comments{/number}","issue_comment_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/comments{/number}","contents_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/contents/{+path}","compare_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/merges","archive_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/downloads","issues_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues{/number}","pulls_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls{/number}","milestones_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/milestones{/number}","notifications_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/labels{/name}","releases_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/releases{/id}","created_at":"2011-10-25T14:30:31Z","updated_at":"2015-08-05T06:26:39Z","pushed_at":"2015-08-31T19:26:17Z","git_url":"git://github.com/learning-unlimited/ESP-Website.git","ssh_url":"git@github.com:learning-unlimited/ESP-Website.git","clone_url":"https://github.com/learning-unlimited/ESP-Website.git","svn_url":"https://github.com/learning-unlimited/ESP-Website","homepage":"","size":59146,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":635,"forks":35,"open_issues":635,"watchers":51,"default_branch":"main"}},"base":{"label":"learning-unlimited:main","ref":"main","sha":"f2b4da9ee9d5b0941d8d8d05f5ad54af0dbc1c01","user":{"login":"learning-unlimited","id":1150905,"avatar_url":"https://avatars.githubusercontent.com/u/1150905?v=3","gravatar_id":"","url":"https://api.github.com/users/learning-unlimited","html_url":"https://github.com/learning-unlimited","followers_url":"https://api.github.com/users/learning-unlimited/followers","following_url":"https://api.github.com/users/learning-unlimited/following{/other_user}","gists_url":"https://api.github.com/users/learning-unlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/learning-unlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learning-unlimited/subscriptions","organizations_url":"https://api.github.com/users/learning-unlimited/orgs","repos_url":"https://api.github.com/users/learning-unlimited/repos","events_url":"https://api.github.com/users/learning-unlimited/events{/privacy}","received_events_url":"https://api.github.com/users/learning-unlimited/received_events","type":"Organization","site_admin":false},"repo":{"id":2643878,"name":"ESP-Website","full_name":"learning-unlimited/ESP-Website","owner":{"login":"learning-unlimited","id":1150905,"avatar_url":"https://avatars.githubusercontent.com/u/1150905?v=3","gravatar_id":"","url":"https://api.github.com/users/learning-unlimited","html_url":"https://github.com/learning-unlimited","followers_url":"https://api.github.com/users/learning-unlimited/followers","following_url":"https://api.github.com/users/learning-unlimited/following{/other_user}","gists_url":"https://api.github.com/users/learning-unlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/learning-unlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learning-unlimited/subscriptions","organizations_url":"https://api.github.com/users/learning-unlimited/orgs","repos_url":"https://api.github.com/users/learning-unlimited/repos","events_url":"https://api.github.com/users/learning-unlimited/events{/privacy}","received_events_url":"https://api.github.com/users/learning-unlimited/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learning-unlimited/ESP-Website","description":"A website to help manage the logistics of large short-term educational programs","fork":false,"url":"https://api.github.com/repos/learning-unlimited/ESP-Website","forks_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/forks","keys_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/teams","hooks_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/hooks","issue_events_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/events{/number}","events_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/events","assignees_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/assignees{/user}","branches_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/branches{/branch}","tags_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/tags","blobs_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/refs{/sha}","trees_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/statuses/{sha}","languages_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/languages","stargazers_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/stargazers","contributors_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/contributors","subscribers_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/subscribers","subscription_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/subscription","commits_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/commits{/sha}","git_commits_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/git/commits{/sha}","comments_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/comments{/number}","issue_comment_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/comments{/number}","contents_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/contents/{+path}","compare_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/merges","archive_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/downloads","issues_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues{/number}","pulls_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls{/number}","milestones_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/milestones{/number}","notifications_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/labels{/name}","releases_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/releases{/id}","created_at":"2011-10-25T14:30:31Z","updated_at":"2015-08-05T06:26:39Z","pushed_at":"2015-08-31T19:26:17Z","git_url":"git://github.com/learning-unlimited/ESP-Website.git","ssh_url":"git@github.com:learning-unlimited/ESP-Website.git","clone_url":"https://github.com/learning-unlimited/ESP-Website.git","svn_url":"https://github.com/learning-unlimited/ESP-Website","homepage":"","size":59146,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":635,"forks":35,"open_issues":635,"watchers":51,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759"},"html":{"href":"https://github.com/learning-unlimited/ESP-Website/pull/1759"},"issue":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1759"},"comments":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1759/comments"},"review_comments":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759/comments"},"review_comment":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1759/commits"},"statuses":{"href":"https://api.github.com/repos/learning-unlimited/ESP-Website/statuses/11fa30ef6359ad62423ea378de4e783c7b6761e4"}}}}