[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-19 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Well, the Windows bot is failing but not from test_fileio, so I'll go ahead and merge it. r68767. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Benjamin Peterson
New submission from Benjamin Peterson benja...@python.org: Since os.fdopen is now implemented with io.open, it doesn't use fdopen and check for invalid file descriptors. This isn't a huge issue since subsequent actions on the file will raise an error. -- components: Library (Lib)

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Perhaps io.open should be fixed, then? (or the _FileIO constructor) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991 ___

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Here's a patch for _FileIO. -- keywords: +patch Added file: http://bugs.python.org/file12790/raise_on_bad_fd.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I think EBADF is defined everywhere, so you can drop the defined() conditional. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991 ___

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Attaching new patch... Added file: http://bugs.python.org/file12791/raise_on_bad_fd2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm not sure Windows has a valid fstat btw, I'll guess we'll see on the Windows buildbots (in that case, some code can be taken from posixmodule.c to emulate fstat behaviour...). Other than that, the patch looks fine to me.

[issue4991] os.fdopen doesn't raise on invalid file descriptors

2009-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Applied in r68755. Will watch Windows. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4991