Commit 675484b6 authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

description, changelog and config files must be encoded in utf-8

parent d8b7c46c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
InstallSystems Configuration files class
'''

import codecs
import os
import sys
from argparse import Namespace
@@ -192,7 +193,7 @@ class RepoConfigFile(ConfigFile):
        debug("Loading repository config file: %s" % self.path)
        try:
            cp = RawConfigParser()
            cp.read(self.path)
            cp.readfp(codecs.open(self.path, "r", "utf8"))
            # each section is a repository
            for rep in cp.sections():
                # check if its a repo section
+3 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
Image stuff
'''

import codecs
import ConfigParser
import cStringIO
import difflib
@@ -493,7 +494,7 @@ class SourceImage(Image):
        try:
            descpath = os.path.join(self.base_path, "description")
            cp = ConfigParser.RawConfigParser()
            cp.read(descpath)
            cp.readfp(codecs.open(descpath, "r", "utf8"))
            for n in ("name","version", "description", "author"):
                d[n] = cp.get("image", n)
            # get min image version
@@ -519,7 +520,7 @@ class SourceImage(Image):
        # try to find a changelog file
        try:
            path = os.path.join(self.base_path, "changelog")
            fo = open(path, "r")
            fo = codecs.open(path, "r", "utf8")
        except IOError:
            return None
        # we have it, we need to check everything is ok