Bug report #12850
scratch.py under user expression folder in master stops 2.8 to start
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | |||
Category: | Expressions | ||
Affected QGIS version: | 2.8.2 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 20943 |
Description
In the latest master, QGIS creates scratch.py under .qgis2/python/expression folder. The file stops older versions of QGIS start and comes up with the following error:
Couldn't load qgis.user.
Python support will be disabled.
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO4~1/apps/qgis/./python\\qgis\\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis/./python\\qgis\\user.py", line 42, in
expressions.load(expressionspath)
File "C:/OSGEO4~1/apps/qgis/./python\\qgis\\user.py", line 19, in load_user_expressions
__import__("expressions.{0}".format(name), locals(), globals())
File "C:/OSGEO4~1/apps/qgis/./python\\qgis\\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/Saber/.qgis2/python\\expressions\\scratch.py", line 9, in
@qgsfunction(group='Custom')
TypeError: qgsfunction() takes exactly 2 arguments (1 given)
To reproduce the error:
1- Open QGIS master
2- Add a vector file
3- Use vector calculator to add a column
4- Save your layer
5- Exit QGIS master
6- Try to open QGIS 2.8.2
Related issues
Associated revisions
Fix #12850 - Add missing args='auto' keyword'
History
#1
Updated by Saber Razmjooei about 9 years ago
- File scratch_29.py
added
- File scratch_28.py
added
Actually, just clicking on the attribute calculater triggers the generation og scratch.py and no other calc is required.
#2
Updated by Saber Razmjooei about 9 years ago
- Priority changed from High to Severe/Regression
#3
Updated by Saber Razmjooei about 9 years ago
- Operating System deleted (
Windows) - OS version deleted (
7)
#4
Updated by Nathan Woodrow about 9 years ago
- Assignee set to Nathan Woodrow
- Resolution set to fixed/implemented
Sorry about that. I made that argument optional and forgot I have to make sure it works in 2.8 where it isn't optional.
#5
Updated by Nathan Woodrow about 9 years ago
- Status changed from Open to Closed
Fixed in changeset 4b6ad0c237f82d0ca08784a8272980e14112c480.