Bug report #8069
Ftools random points: a python error
|Affected QGIS version:||master||Regression?:|
|Operating System:||Easy fix?:|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16908|
Steps to reproduce
Use value from input field (in this case "id" which is NULL)
An error has occured while executing Python code: Traceback (most recent call last): File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 124, in accept self.randomize(inLayer, outPath, minimum, design, value) File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 225, in randomize add = ( 100.00 - 70.00 ) / len(points) ZeroDivisionError: float division by zero Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3] QGIS version: 1.9.0-Master Master, exported Python path: ['/usr/share/qgis/python/plugins/sextante', '/usr/share/qgis/python', '/home/fd/.qgis2/python', '/home/fd/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', '/usr/share/qgis/python/plugins/fTools/tools']
#3 Updated by Giovanni Manghi over 9 years ago
- Status changed from Open to Feedback
Filipe Dias wrote:
Im using the latest version before the SIP update.
then you should re-test after updating, the code of the core python plugins have already been changed, so testing not the latest revision does not make sense anyway.
#4 Updated by Giovanni Manghi over 9 years ago
- OS version deleted (
- Status changed from Feedback to Open
- Target version set to Version 2.0.0
- Operating System deleted (
If you choose a column with no values (and it should have something to work) then the error is the one you report.
Anyway on the latest revision it fails with
An error has occured while executing Python code: Traceback (most recent call last): File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 94, in accept if outPath.contains("\\\\"): AttributeError: 'unicode' object has no attribute 'contains' Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3]
even when choosing a column that makes sense.
#6 Updated by Giovanni Manghi over 9 years ago
Filipe Dias wrote:
Of course it should not be empty. But a warning message should be displayed (e.g. The selected field has NULL values) instead of a Python error.
yes of course, that situation would need to be trapped, but that is not would not be enough to make this a blocker. On the other hand the tools nows fail anyway so after all this is really a regression.
#8 Updated by Daniel Vaz over 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100