SciLifeLab / bcbb

Useful bioinformatics code, primarily in Python and R
http://bcbio.wordpress.com
10 stars 11 forks source link

Invalid cross-device link solved by substituting os.rename by shutil.move #279

Closed guillermo-carrasco closed 11 years ago

guillermo-carrasco commented 11 years ago

I've encountered these messages in the logs:

  File "/home/hiseq.bioinfo/.virtualenvs/master/lib/python2.7/site-packages/bcbio_nextgen-1.0_82_g2756ba6-py2.7.egg/bcbio/utils.py", line 400, in merge_demux_results
    os.rename(unaligned_dirs[0], 'Unaligned')
OSError: [Errno 18] Invalid cross-device link

According to several threads (just google for "os.rename Invalid cross-device link"), os.rename may have problems in mounted/shared partitions, which I didn't realized because I was testing locally.