[New-bugs-announce] [issue7881] Hardcoded path, unsafe tempfile in test_logging

Neil Schemenauer report at bugs.python.org
Mon Feb 8 01:06:30 CET 2010

New submission from Neil Schemenauer <nas-python at arctrix.com>:

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().

assignee: vinay.sajip
components: Tests
messages: 99032
nosy: nascheme, vinay.sajip
severity: normal
stage: needs patch
status: open
title: Hardcoded path, unsafe tempfile in test_logging
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list