id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
4568	[with patch, positive review] Dangerous doc test of save_session	SimonKing	mabshoff	"The doc test of `save_session` does the following:
{{{
        EXAMPLES:
            sage: a = 5
            sage: save_session('session')
        
        ...
        Clean up the session file we just wrote to disk.
            sage: os.unlink('session.sobj')
}}}

Hence, if the user happens to have a file `session.sobj` in the current directory then running the doc test would destroy it.

According to a suggestion of Robert Bradshow, using the `tempfile` Python module might help.

Unfortunately I have no idea in what file `save_session` is defined - so, no patch at that point..."	defect	closed	major	sage-3.2.1	doctest coverage	fixed	save_session temporary file								
