{"action":"created","issue":{"url":"https://api.github.com/repos/tqdm/tqdm/issues/202","repository_url":"https://api.github.com/repos/tqdm/tqdm","labels_url":"https://api.github.com/repos/tqdm/tqdm/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/tqdm/tqdm/issues/202/comments","events_url":"https://api.github.com/repos/tqdm/tqdm/issues/202/events","html_url":"https://github.com/tqdm/tqdm/issues/202","id":166685594,"number":202,"title":"I/O operation on closed file bug","user":{"login":"pauljherrera","id":17938135,"avatar_url":"https://avatars.githubusercontent.com/u/17938135?v=3","gravatar_id":"","url":"https://api.github.com/users/pauljherrera","html_url":"https://github.com/pauljherrera","followers_url":"https://api.github.com/users/pauljherrera/followers","following_url":"https://api.github.com/users/pauljherrera/following{/other_user}","gists_url":"https://api.github.com/users/pauljherrera/gists{/gist_id}","starred_url":"https://api.github.com/users/pauljherrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauljherrera/subscriptions","organizations_url":"https://api.github.com/users/pauljherrera/orgs","repos_url":"https://api.github.com/users/pauljherrera/repos","events_url":"https://api.github.com/users/pauljherrera/events{/privacy}","received_events_url":"https://api.github.com/users/pauljherrera/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tqdm/tqdm/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-07-20T21:23:43Z","updated_at":"2016-08-01T16:08:33Z","closed_at":null,"body":"Eighty percent of the time I use tqdm it works perfectly. The other 20%  I get 'I/O operation on closed file'.\r\n\r\nThe weird thing about it is that I can use tqdm in the same script two times. The first time it doesn't work. The second time, without changing anything , it works.\r\n\r\nI paste below the complete traceback:\r\n\r\n```\r\nFile \"<ipython-input-160-51605e3202c6>\", line 1, in <module>\r\n    runfile('C:/Users/forex/Documents/Knoxpy simple/Avanti_Analyzer.py', wdir='C:/Users/forex/Documents/Knoxpy simple')\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\spyderlib\\widgets\\externalshell\\sitecustomize.py\", line 699, in runfile\r\n    execfile(filename, namespace)\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\spyderlib\\widgets\\externalshell\\sitecustomize.py\", line 74, in execfile\r\n    exec(compile(scripttext, filename, 'exec'), glob, loc)\r\n\r\n  File \"C:/Users/forex/Documents/Knoxpy simple/Avanti_Analyzer.py\", line 1114, in <module>\r\n    barsperday, commission, swap, join, verbose = True)\r\n\r\n  File \"C:/Users/forex/Documents/Knoxpy simple/Avanti_Analyzer.py\", line 1022, in w_eventstudy\r\n    df = overlaps(df, overlapperiod, signal, trigger)\r\n\r\n  File \"C:/Users/forex/Documents/Knoxpy simple/Avanti_Analyzer.py\", line 438, in overlaps\r\n    for i in tqdm(xrange(overlapperiod - 1, len(x1))):\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\tqdm\\_tqdm.py\", line 622, in __iter__\r\n    else ncols),\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\tqdm\\_tqdm.py\", line 98, in print_status\r\n    fp_write('\\r' + s + (' ' * max(last_len[0] - len_s, 0)))\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\tqdm\\_tqdm.py\", line 92, in fp_write\r\n    fp_flush()\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\colorama\\ansitowin32.py\", line 40, in write\r\n    self.__convertor.write(text)\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\colorama\\ansitowin32.py\", line 141, in write\r\n    self.write_and_convert(text)\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\colorama\\ansitowin32.py\", line 169, in write_and_convert\r\n    self.write_plain_text(text, cursor, len(text))\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\colorama\\ansitowin32.py\", line 174, in write_plain_text\r\n    self.wrapped.write(text[start:end])\r\n\r\n  File \"C:\\Anaconda2\\lib\\site-packages\\ipykernel\\iostream.py\", line 317, in write\r\n    self._buffer.write(string)\r\n\r\nValueError: I/O operation on closed file\r\n```"},"comment":{"url":"https://api.github.com/repos/tqdm/tqdm/issues/comments/236626889","html_url":"https://github.com/tqdm/tqdm/issues/202#issuecomment-236626889","issue_url":"https://api.github.com/repos/tqdm/tqdm/issues/202","id":236626889,"user":{"login":"lrq3000","id":1118942,"avatar_url":"https://avatars.githubusercontent.com/u/1118942?v=3","gravatar_id":"","url":"https://api.github.com/users/lrq3000","html_url":"https://github.com/lrq3000","followers_url":"https://api.github.com/users/lrq3000/followers","following_url":"https://api.github.com/users/lrq3000/following{/other_user}","gists_url":"https://api.github.com/users/lrq3000/gists{/gist_id}","starred_url":"https://api.github.com/users/lrq3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrq3000/subscriptions","organizations_url":"https://api.github.com/users/lrq3000/orgs","repos_url":"https://api.github.com/users/lrq3000/repos","events_url":"https://api.github.com/users/lrq3000/events{/privacy}","received_events_url":"https://api.github.com/users/lrq3000/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T16:08:33Z","updated_at":"2016-08-01T16:08:33Z","body":"Update: the patch that should seemingly fix this issue is not yet committed to IPython public releases, it will be out shortly with IPython v4.4. We should try again then to see if this fixes the issue for good."}}
{"actor":{"display_login":"lrq3000"}}