This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Hardcoded path, unsafe tempfile in test_logging
Type: behavior Stage: needs patch
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: kbk, nascheme, vinay.sajip
Priority: normal Keywords:

Created on 2010-02-08 00:06 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg99032 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2010-02-08 00:06
The commit for issue #7868 added the following line to test_logging:

print >> open('/tmp/tmp.txt', 'w'), type(logger)

I'm not sure if that was intentional but it should be fixed.  For one, that path does not necessarily exist.  Secondly, opening a file in a world writable directory like that is a potential security problem.  A simple fix would be to use tempfile.TemporaryFile().
msg99037 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2010-02-08 03:29
In addition, the /tmp/tmp.txt file is only writeable by the user that created it.  On the buildbot machine I'm admin'ing, the buildslave user created the file and user neal's run of build.sh on the trunk fails because it can't write the file.  Also, to avoid clutter in /tmp, the file should not only be created safely as Neil suggests, but removed when the test is complete.
msg99039 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-02-08 06:51
Sorry for the goof; that line was unintentionally left in. Now removed (r78103).
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52129
2010-02-08 06:51:21vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg99039
2010-02-08 03:29:02kbksetnosy: + kbk
messages: + msg99037
2010-02-08 00:06:29naschemecreate