-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logging error in the QGIS-python console (print) #28
Comments
When adding the QGIS feedback logger to the aligner, ther isn't a problem. When setting this to None this error occurs. To check if brdr handles this correctly when no QGIS-logger is provided. |
@roefem I have a question about this. I also made a advanced parameter in the UI to not include the feedback-logger. So None is provided on initialisation. this results in error in the printing module of QGIS, because logging cannot be written. You have an idea how to handle this in the most clean way? Or should we always provide a QGIS-feedback-logger? (I removed this because too much info was written down in the QGIS log so the feedback-logger could not follow writing and was slowing the processing) |
zie: Lines 684 to 691 in 5fd46d8
|
fix was needed in brdr. This fix will be available from version >=0.2.2 |
we close this here as this is already fixed in brdr |
When executing brdrQ, a logging error is shown in the QGIS python print console:
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init_.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 668, in processAlgorithm
aligner = Aligner(feedback=log_info,
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 158, in init
self.logger.feedback_info("Aligner initialized")
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'Aligner initialized'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init_.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 705, in processAlgorithm
aligner.load_reference_data(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 1054, in load_reference_data
) = loader.load_data()
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\grb.py", line 438, in load_data
self.aligner.logger.feedback_info(f"GRB downloaded: {self.grb_type}")
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'GRB downloaded: GRBType.ADP'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init_.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 705, in processAlgorithm
aligner.load_reference_data(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 1055, in load_reference_data
self.prepare_reference_data()
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 682, in prepare_reference_data
self.logger.feedback_info(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'length of reference_dict: 366'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 717, in processAlgorithm
process_result = aligner.process_dict_thematic(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 301, in process_dict_thematic
self.logger.feedback_info("thematic id to process: " + str(key))
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'thematic id to process: 100'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 717, in processAlgorithm
process_result = aligner.process_dict_thematic(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 301, in process_dict_thematic
self.logger.feedback_info("thematic id to process: " + str(key))
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'thematic id to process: 200'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init_.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232, in executeAlgorithmself.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435, in executeAlgorithmdlg.exec()
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", line 332, in runAlgorithmok, results = execute(self.algorithm(), parameters, self.context, self.feedback)
File "C:\PROGRA
1/QGIS331.1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 62, in executeresults, ok = alg.run(parameters, context, feedback)
File "C:\Users\KarelDieussaert\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\autocorrectborders.py", line 717, in processAlgorithm
process_result = aligner.process_dict_thematic(
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\aligner.py", line 301, in process_dict_thematic
self.logger.feedback_info("thematic id to process: " + str(key))
File "C:\Users\KarelDieussaert\AppData\Roaming\Python\Python312\site-packages\brdr\logger.py", line 22, in feedback_info
logging.info(text)
Message: 'thematic id to process: 300'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\PROGRA
1\QGIS331.1\apps\Python312\Lib\logging_init_.py", line 1163, in emitstream.write(msg + self.terminator)
^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered: