Indents in scratch.py written by 2.10 causes IndentationError in 2.8.2-LTR #21129
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Expressions
Related to the QGIS expression engine or specific expression functions
Milestone
Author Name: Kristian Evers (@kbevers)
Original Redmine Issue: 13059
Affected QGIS version: master
Redmine category:expressions
This bug presents it self when running two version of QGIS, 2.10.0 and 2.8.2-ltr, on the same computer with the same user.
The problem is that QGIS 2.10 automatically writes a poorly formatted scratch.py in .qgis2/plugins/expressions/. The generated file results in an IndentationError when QGIS 2.8.2-ltr is opened. The IndentationError occurs because all lines (except the first) in the file are indented for spaces. This obviously doesn't play nicely with the python interpreter. The exception is not seen in 2.10 because exceptions caused by bad user-code are not raised.
The problem arises in python/user.py because of a indented doc-string. I have attached a copy of a user.py that outputs a file that is formatted properly.
The text was updated successfully, but these errors were encountered: