repoze/repoze.filesafe — Issue #2: Permanent ERRNO 18
Author: marplatense
Created: 2011-12-07 04:20:10+00:00
State: open

This is probably me not knowing how to use filesafe but I have been unable to google a good answer and the problem seems easily reproducible:

using Pyramid:

$ paster pshell test.ini -p python
Python 2.7.2 (default, Oct 14 2011, 23:34:02)
[GCC 4.5.2] on linux2
Type "help" for more information.

Environment:
app The WSGI application.
registry Active Pyramid registry.
request Active request object.
root Root of the default resource tree.
root_factory Default root factory used to create `root`.

Custom Variables:
mod smd.models
s smd.models.S
t transaction

>>> from repoze.filesafe import create_file
>>> f = create_file('hello_world', 'wb')
>>> f.write('hola mundo, esto es una prueba')
>>> f.close()
>>> t.commit()
Traceback (most recent call last):
File "", line 1, in
File "/home/mariano/Code/SmD/env/lib/python2.7/site-packages/transaction/_manager.py", line 89, in commit
return self.get().commit()
File "/home/mariano/Code/SmD/env/lib/python2.7/site-packages/transaction/_transaction.py", line 329, in commit
self._commitResources()
File "/home/mariano/Code/SmD/env/lib/python2.7/site-packages/transaction/_transaction.py", line 443, in _commitResources
rm.commit(self)
File "/home/mariano/Code/SmD/env/lib/python2.7/site-packages/repoze/filesafe/manager.py", line 90, in commit
os.rename(info["tempfile"], target)
OSError: [Errno 18] Invalid cross-device link