Fix owner_* rights with python2 (fix #49)

This commit is contained in:
Guillaume Ayoub 2013-08-21 06:58:30 +02:00
parent f7f26afd6b
commit 07a9ce8296

View File

@ -24,6 +24,7 @@ Rights management.
"""
import re
import io
import os.path
from . import config, log
@ -50,7 +51,7 @@ def _read_from_sections(user, collection, permission):
regex = ConfigParser({"login": user, "path": collection})
if TYPE in DEFINED_RIGHTS:
log.LOGGER.debug("Rights type '%s'" % TYPE)
regex.read_string(DEFINED_RIGHTS[TYPE])
regex.readfp(io.BytesIO(DEFINED_RIGHTS[TYPE]))
elif TYPE == "from_file":
log.LOGGER.debug("Reading rights from file %s" % FILENAME)
if not regex.read(FILENAME):