a tightly-configured trac instance might not always have write access to
its own conf/directory.
the trac-sqlite2pg contributed script in debian's trac package seems to
assume that it has write access in order to make a temporary copy of the
config.
i get the following error:
Traceback (most recent call last):
File "/usr/local/bin/trac-sqlite2pg", line 335, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/trac-sqlite2pg", line 331, in main
Main(opts)
File "/usr/local/bin/trac-sqlite2pg", line 244, in Main
pgenv = getPostgreSQLEnvironment(opts)
File "/usr/local/bin/trac-sqlite2pg", line 220, in getPostgreSQLEnvironment
x.environment_created()
File "/usr/lib/python2.5/site-packages/trac/env.py", line 504, in environment_created
self._update_sample_config()
File "/usr/lib/python2.5/site-packages/trac/env.py", line 545, in _update_sample_config
config.save()
File "/usr/lib/python2.5/site-packages/trac/config.py", line 211, in save
fileobj = AtomicFile(self.filename, 'w')
File "/usr/lib/python2.5/site-packages/trac/util/__init__.py", line 163, in __init__
(fd, self._temp) = tempfile.mkstemp(prefix=name + '-', dir=dir)
File "/usr/lib/python2.5/tempfile.py", line 302, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib/python2.5/tempfile.py", line 236, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/srv/trac/support/conf/trac.ini.sample-b3-m7y'
It would be better if this script created the sample config in /tmp, or
following $TMPDIR instead of trying to write a new file into conf/ (or
at least check for that error, and fall back to making the sample config
in /tmp if conf/ is unwritable by the user writing the query.
Regards,