[issue15447] A file is not properly closed by webbrowser._invoke

2012-09-03 Thread R. David Murray
R. David Murray added the comment: Thanks, Anton. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue15447] A file is not properly closed by webbrowser._invoke

2012-09-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 901c790e4417 by R David Murray in branch 'default': #15447: Use subprocess.DEVNULL in webbrowser, instead of opening http://hg.python.org/cpython/rev/901c790e4417 New changeset 5da3b2df38b3 by R David Murray in branch 'default': #15557,#15447,#15509

[issue15447] A file is not properly closed by webbrowser._invoke

2012-08-04 Thread Anton Barkovsky
Anton Barkovsky added the comment: Added tests in #15557. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-30 Thread Anton Barkovsky
Anton Barkovsky added the comment: An updated patch with the same issue fixed in Konqueror class. -- Added file: http://bugs.python.org/file26602/fileclose_devnull_v2.patch ___ Python tracker __

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread R. David Murray
R. David Murray added the comment: You could do it either way. Normally we prefer to have a test along with any fix; in this case adding a test involves adding the test module as well, but it is not different in principle. If you want to work on it and prefer to have it as a separate issue

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread Anton Barkovsky
Anton Barkovsky added the comment: Adding a patch that uses subprocess.DEVNULL instead. Writing tests for webbrowser should be a separate issue, right? -- Added file: http://bugs.python.org/file26513/fileclose_devnull.patch ___ Python tracker

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread R. David Murray
R. David Murray added the comment: @Anton: That's what I was guessing. If we had a unit test in test_webbrowser that did the same thing, we'd have seen the resource warning when running the tests and fixed it. However, it looks like there aren't *any* tests for webbrowser, not even in test_

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread Ross Lagerwall
Ross Lagerwall added the comment: Are there any webbrowser unit tests? (this could probably use the new subprocess.DEVNULL constant in 3.3) -- nosy: +rosslagerwall ___ Python tracker _

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread Anton Barkovsky
Anton Barkovsky added the comment: To clarify, I discovered this when I was simply running webbrowser.open in REPL. -- ___ Python tracker ___ ___

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread Anton Barkovsky
Anton Barkovsky added the comment: The warning is printed by the file object when it closes itself in __del__: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r+' encoding='UTF-8'> There isn't much to test, or is there? -- _

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread R. David Murray
R. David Murray added the comment: Thanks. Is this warning printed by the webbrowser unit tests? If not can you see a way to add one that does? -- nosy: +r.david.murray ___ Python tracker __

[issue15447] A file is not properly closed by webbrowser._invoke

2012-07-25 Thread Anton Barkovsky
New submission from Anton Barkovsky : webbrowser._invoke opens /dev/null, never closes it and a warning is printed. I'm attaching a patch. The diff looks messy, but I'm just wrapping the code in a try-finally block, the rest is just indented. -- components: Library (Lib) files: fileclos