Limit length of filenames (#311)

* Limit length of filenames

If whipper generated filenames are longer thant the maximum value supported by the filesystem, the I/O operations are going to fail.
With this commit filenames which may be too long are truncated to the maximum allowable length.

Fixes #197.
This commit is contained in:
JoeLametta
2018-10-22 20:51:14 +02:00
committed by GitHub
parent 669b356daa
commit 02fd962094
3 changed files with 20 additions and 5 deletions

View File

@@ -481,8 +481,8 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
except IOError as e:
if errno.ENAMETOOLONG != e.errno:
raise
path = common.shrinkPath(path)
tmpoutpath = path + u'.part'
path = common.truncate_filename(common.shrinkPath(path))
tmpoutpath = common.truncate_filename(path + u'.part')
open(tmpoutpath, 'wb').close()
self._tmppath = tmpoutpath
self.path = path