Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #479 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] test_command_i18n fails with "[Errno 18] Invalid cross-device link"

Reported by: mbrubeck@… Owned by: anonymous
Priority: normal Milestone:
Component: TurboGears Version:
Severity: normal Keywords:


(Using SVN rev 588.) If /tmp is on a different filesystem than the directory where "nosetests" is run, test_command_i18n.test_creates_locale_dir fails with this stack trace:

  File "/home/mbrubeck/src/turbogears/turbogears/tests/test_command_i18n.py", line 33, in test_creates_locale_dir
  File "/home/mbrubeck/src/turbogears/turbogears/command/i18n.py", line 109, in run
  File "/home/mbrubeck/src/turbogears/turbogears/command/i18n.py", line 196, in scan_source_files
    os.rename('tmp.pot', potfile)
OSError: [Errno 18] Invalid cross-device link

This happens because command.i18n.scan_source_files creates a temporary file in the current working directory, and later calls os.rename() to move that file to the locale directory (which is in /tmp). If /tmp and $PWD are on different filesystems, os.rename() throws an exception.

A patch is attached to fix this problem.


i18n_tmp_potfile.diff Download (1.7 KB) - added by mbrubeck@… 13 years ago.

Change History

Changed 13 years ago by mbrubeck@…

comment:1 Changed 13 years ago by anonymous

  • Component changed from CherryPy to TurboGears

comment:2 Changed 13 years ago by Max

  • Status changed from new to closed
  • Resolution set to fixed

Fixed. Thanks for the patch!

Note: See TracTickets for help on using tickets.