infinite recursion when conf directory is read-only
|Reported by:||Owned by:|
If the conf directory is read-only, trac goes into an endless recursion. The only thing visible on the command line is:
Exception RuntimeError: 'maximum recursion depth exceeded' in <bound method AtomicFile.rollback of <trac.util.AtomicFile object at 0x7f166c897c10>> ignored
This is because self._file in AtomicFile is declared after mkstemp and because
__del__ is an alias for rollback(). If mkstemp fails, self._file is undefined, causing an endless recursion in rollback which tries to access this variable.
The solution is to add 'self._file = None' before mkstemp.
This problem is present in 0.11 and 0.12 - however we had a couple of user reports so I would like to see the fix also for 0.11.7.
Thanks to Sergey for reporting/diagnosing the issue.