Change in vdsm[master]: Fix configfile to use unicode which allows to add toolTests ...

nsoffer at redhat.com nsoffer at redhat.com
Fri Apr 8 08:59:22 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: Fix configfile to use unicode which allows to add toolTests to python3 check
......................................................................


Patch Set 14:

(1 comment)

https://gerrit.ovirt.org/#/c/48052/14/lib/vdsm/tool/configfile.py
File lib/vdsm/tool/configfile.py:

Line 114:     def _getOldContent(self):
Line 115:         confpat = re.compile(r'^\s*(?P<key>[^=\s#]*)\s*=')
Line 116:         oldlines = []
Line 117:         oldentries = set()
Line 118:         with io.open(self._filename, 'r', encoding='utf8') as f:
> we might have unicode values... i don't know. why to limit?
Reading and writing files using text mode (unicode) is much slower. When we don't need to support unicode, we should not.

Unfortunately, configparser in python 3 cannot read binary files, so we have no choice.
Line 119:             for line in f:
Line 120:                 if self._remove:
Line 121:                     if (self._rmstate == BEFORE and
Line 122:                             line.startswith(self._sectionStart)):


-- 
To view, visit https://gerrit.ovirt.org/48052
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I52f11a1a10cae46773d05d0c09da80ad8eb3b772
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list