More detailed error output on corrupt UID mapping files

This function will need much more "robustifying", but the very least we
can do is to print the file name and line that are giving trouble.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-05-02 11:44:19 +02:00 committed by Nicolas Sebrecht
parent 12e11429b5
commit 2ed1c357a0
2 changed files with 7 additions and 1 deletions

View File

@ -16,6 +16,8 @@ New Features
Changes
-------
* Give more detailed error when encountering a corrupt UID mapping file.
Bug Fixes
---------

View File

@ -51,7 +51,11 @@ class MappingFolderMixIn:
line = file.readline()
if not len(line):
break
try:
line = line.strip()
except ValueError:
raise Exception("Corrupt line '%s' in UID mapping file '%s'" \
%(line, mapfilename))
(str1, str2) = line.split(':')
loc = long(str1)
rem = long(str2)