<div dir="ltr">SinceĀ <a href="https://github.com/qgis/QGIS/pull/469">https://github.com/qgis/QGIS/pull/469</a> (quite old) you're supposed to get a warning message in the console when using invalid keys.<div><br><div>Keys must be valid XML names in order to be properly saved to the file.</div></div><div><br></div><div>To me, being able to use invalid keys in the first place could arguably be considered as a bug. It would maybe be better to have an exception thrown in these cases.</div><div><br></div><div>Best regards,</div><div><br></div><div>Olivier</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-24 17:34 GMT+00:00 Tom Chadwin <span dir="ltr"><<a href="mailto:tom.chadwin@nnpa.org.uk" target="_blank">tom.chadwin@nnpa.org.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't know if this deduction from a lot of banging my head against a bug is<br>
correct, but this seems to me to be the behaviour:<br>
<br>
1. QgsProject.instance().<wbr>writeEntry() a variable with spaces in the variable<br>
name<br>
2. Read it back in - this works<br>
3. Save your project<br>
4. Read it back in - works<br>
5. Close your project (open a different one, or close QGIS)<br>
6. Reopen your project<br>
7. Read it back in - fails<br>
<br>
This does not seem to affect var names with no spaces. So the spaces are<br>
being stripped, but only when written to the project file, not when they are<br>
still in memory?<br>
<br>
Can anyone confirm? Is this a bug?<br>
<br>
<br>
<br>
-----<br>
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/QgsProject-instance-writeEntry-with-spaces-in-var-name-tp5282208.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.<wbr>nabble.com/QgsProject-<wbr>instance-writeEntry-with-<wbr>spaces-in-var-name-tp5282208.<wbr>html</a><br>
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></blockquote></div><br></div>