Skip to content

Fixed AttributeError in ProgressBar in case sys.stderr is None. Added tests for processing module.

Daniel Scheffler requested to merge bugfix/fix_NonetypeError into master

This fixes the following AttributeError in case sys.stderr is None which is ...

usually the case for Windows GUI apps that aren’t connected to a console and Python apps started with pythonw.

Traceback (most recent call last):
File "C:\Users/PedroVenancio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Coregistration\automated_local_coregistration_algorithm.py", line 278, in processAlgorithm
CRL.correct_shifts()
File "C:\Users\PedroVenancio\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\Coregistration\extlibs_windows\arosics\CoReg_local.py", line 810, in correct_shifts
self.calculate_spatial_shifts()
File "C:\Users\PedroVenancio\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\Coregistration\extlibs_windows\arosics\CoReg_local.py", line 480, in calculate_spatial_shifts
self._tiepoint_grid.get_CoRegPoints_table()
File "C:\Users\PedroVenancio\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\Coregistration\extlibs_windows\arosics\Tie_Point_Grid.py", line 419, in get_CoRegPoints_table
bar.print_progress((i + 1) / len(GDF) * 100)
File "C:\Users\PedroVenancio\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\Coregistration\extlibs_windows\py_tools_ds\processing\progress_mon.py", line 124, in print_progress
self.out.write('\r')
AttributeError: 'NoneType' object has no attribute 'write'

See here.

Merge request reports

Loading