Refuse to alter read-only elements at runtime
authorJeremy Stanley <fungi@yuggoth.org>
Mon, 31 Jul 2017 15:00:33 +0000 (15:00 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 31 Jul 2017 15:00:33 +0000 (15:00 +0000)
commit705fe9a0a0e5bc25989cbac3944dad5763f69446
tree79d39859fe6ad13a0c0007eaa50ad90c56b2231c
parent0d186d17647d956c9ffc7f36d4a250fa4d54a0f0
Refuse to alter read-only elements at runtime

In the Element.set() method, check whether the element being altered
is from a read-only file. That should only ever happen when
(re)loading of files is underway, either at start time or because
the reload command/SIGHUP has been issued. If an attempt is made to
change a read-only element at any other time, raise a
PermissionError exception instead of setting the new value in memory
(altered values were never written to the backing file, but prior to
this it was possible to modify the in-memory copies).
mudpy/misc.py