[issue23566] RFE: faulthandler.register() should support file descriptors

2015-04-06 Thread STINNER Victor
STINNER Victor added the comment: However I think the fd tests on windows is just fine to be skipped. So what's the next plan? Shall we continue to work on it or just resolve this issue? issue23566_fd_tests_v2.patch makes test_faulthandler.py a little more complex. It's maybe better to just

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-04-01 Thread Wei Wu
Wei Wu added the comment: @haypo, would you review issue23566_fd_tests_v2.patch? It's been a time since the last update of it. However I think the fd tests on windows is just fine to be skipped. So what's the next plan? Shall we continue to work on it or just resolve this issue? --

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-18 Thread Wei Wu
Wei Wu added the comment: The updated patch refactored test code a little bit according to the latest review comments by Victor. -- Added file: http://bugs.python.org/file38546/issue23566_fd_tests_v2.patch ___ Python tracker rep...@bugs.python.org

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-16 Thread STINNER Victor
STINNER Victor added the comment: I reviewed issue23566_fd_tests.patch . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566 ___ ___

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-14 Thread Wei Wu
Wei Wu added the comment: I attached a patch that implements the solution described above. -- Added file: http://bugs.python.org/file38480/issue23566_fd_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-13 Thread Wei Wu
Wei Wu added the comment: The last approach I proposed requires some change in template code of check_xxx methods. To make it better, we can add a bool parameter to the check_xxx functions, True value indicating a fd test. If a filename is given at the same time, then a fd can get from that

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-13 Thread STINNER Victor
STINNER Victor added the comment: I commited a fix to repair Windows buildbots. Or we could reuse the file created by filename in subprocess? I tried to pass a file descriptor from the parent to the child process, but this option is complex. It's possible to pass a handle with

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 211e29335e72 by Victor Stinner in branch 'default': Issue #23566: Skip fd tests of test_faulthandler on Windows https://hg.python.org/cpython/rev/211e29335e72 -- ___ Python tracker rep...@bugs.python.org

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-13 Thread Christoph Sieghart
Changes by Christoph Sieghart s...@0x2a.at: -- nosy: -sigi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566 ___ ___ Python-bugs-list mailing

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-12 Thread Wei Wu
Wei Wu added the comment: Updated the patch and addressed the previous review comments: * Fixed the hasattr problem * Added a default value None for filename in check_dump_traceback * Reverted unnecessary code change in check_dump_traceback_later * Added a new paragraph to the enable,

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-12 Thread STINNER Victor
STINNER Victor added the comment: Let me know if there is possible further improvement in this patch. I was going to push your change, but I noticed that you use stderr.fileno() in tests. I modified the test to use a different file descriptor. sys.stderr is also the default value, so the

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-12 Thread STINNER Victor
STINNER Victor added the comment: Oops, I forgot Windows. On Windows, we should maybe use stderr.fileno() and avoid pass_fds. (Or maybe just skip the tests on Windows?) http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5828/steps/test/logs/stdio

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset e78de5b1e3ef by Victor Stinner in branch 'default': Issue #23566: enable(), register(), dump_traceback() and dump_traceback_later() https://hg.python.org/cpython/rev/e78de5b1e3ef -- nosy: +python-dev ___

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-12 Thread Wei Wu
Wei Wu added the comment: Or we could reuse the file created by filename in subprocess? if filename: file = open(filename, wb) if use_fd: file = file.fileno() else: file = None In this case, we need to pass two arguments(both filename and a bool use_fd) to check_xxx

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-11 Thread STINNER Victor
STINNER Victor added the comment: issue23566_update.patch looks good to me, but I suggested some minor changes. Usually, I do such changes myself, but I proposed this issue on the Python menthorship list, so I prefer to do the changes to learn the process of reviewing patches and taking

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-10 Thread Wei Wu
Wei Wu added the comment: Attached a patch to this issue. Made some changes to faulthandler_get_fileno to accept integer as fd. If a fd is provided, the file member of fatal_error struct is set NULL. An new test case is added and some common testing code is also changed in order to be

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-10 Thread STINNER Victor
STINNER Victor added the comment: @kilowu: Thanks, I reviewed your patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566 ___ ___

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-10 Thread Wei Wu
Wei Wu added the comment: @haypo: Thank you for your review. I attached an updated patch addressing the review comments. In addition, I also added a change note in Misc/NEWS. -- Added file: http://bugs.python.org/file38436/issue23566_update.patch

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-04 Thread Christoph Sieghart
Changes by Christoph Sieghart s...@0x2a.at: -- nosy: +sigi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566 ___ ___ Python-bugs-list mailing

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-02 Thread STINNER Victor
New submission from STINNER Victor: Currently, functions of the faulthandler module require a file-like object (with a fileno() method). It would be nice to accept also file descriptors (int). Example of code using faulthandler which creates an useless file object just to pass a file

[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-02 Thread STINNER Victor
STINNER Victor added the comment: Only faulthandler_get_fileno() should be modified, but a new unit test should be added. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23566 ___