* morituri/common/common.py:
Add shrinkPath to write shorter path names. * morituri/test/test_common_common.py (added): Add test. * morituri/program/cdparanoia.py: Catch ENAMETOOLONG and shrink path. * morituri/common/program.py: Update track result's filename if it was shrunk. * morituri/rip/cd.py: set the possibly shrunk path on the result.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
# along with morituri. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import errno
|
||||
import re
|
||||
import stat
|
||||
import shutil
|
||||
@@ -478,6 +479,10 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
|
||||
try:
|
||||
self.debug('Moving to final path %r', self.path)
|
||||
shutil.move(self._tmppath, self.path)
|
||||
except IOError, e:
|
||||
if e.errno == errno.ENAMETOOLONG:
|
||||
self.path = common.shrinkPath(self.path)
|
||||
shutil.move(self._tmppath, self.path)
|
||||
except Exception, e:
|
||||
self.debug('Exception while moving to final path %r: %r',
|
||||
self.path, log.getExceptionMessage(e))
|
||||
|
||||
Reference in New Issue
Block a user