Fix reading of config property on first line
If arsnova.properties did not start with comments and had a property on the first line it was ignored.
-
Have to revert this change in order to use the tool.py on arsnova.thm.de.
With this change in, i'll get the following:
Traceback (most recent call last): File "tool.py", line 63, in <module> (db, conn) = couchconnection.arsnova_connection("/etc/arsnova/arsnova.properties") File "/root/arsnova-setuptool/couchconnection.py", line 60, in arsnova_connection config = configreader.ConfigReader(propertypath) File "/root/arsnova-setuptool/configreader.py", line 7, in __init__ self.readProperties(propertiesFile) File "/root/arsnova-setuptool/configreader.py", line 20, in readProperties config.readfp(io.BytesIO("[arsnova]\n" + properties)) File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp self._read(fp, filename) File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read raise e ConfigParser.ParsingError: File contains parsing errors: <???> [line 2]: 'q################################################################################\n'
-
It looks to me like it is just a coincidence that reverting this change fixes the problem.
The real problem here is that the config file is invalid:
[line 2]: 'q################################################################################\n'
Edited by Daniel Gerhardt -
No problem. Without the commit, the parser would read
[arsnova]q###...
and just ignore anything behind the closing brace. So the problem would also occur after a revert if you add an empty line to the beginning of the config file yourself.Edited by Daniel Gerhardt
Please register or sign in to comment