Skip to content

Fix tqdm crash in TARGET (#116): route progress through QgsProcessingFeedback#142

Open
jixuan-chen wants to merge 1 commit into
UMEP-dev:mainfrom
jixuan-chen:fix/target-qgis-feedback
Open

Fix tqdm crash in TARGET (#116): route progress through QgsProcessingFeedback#142
jixuan-chen wants to merge 1 commit into
UMEP-dev:mainfrom
jixuan-chen:fix/target-qgis-feedback

Conversation

@jixuan-chen

@jixuan-chen jixuan-chen commented Jul 23, 2026

Copy link
Copy Markdown

Fixes #116.

tqdm writes its progress bar to sys.stdout, which QGIS sets to None when the Python console is not open, crashing with AttributeError: 'NoneType' object has no attribute 'write' (and the same for the logging calls in the same run).

target-py 0.2.0 adds an optional feedback parameter to Target(...) that routes progress through a QgsProcessingFeedback/QgsFeedback object instead of tqdm when one is provided. This wires it through in target_algorithm.py.

Requires target-py>=0.2.0. Companion PR bumping the version pin in umep-reqs: UMEP-dev/umep-reqs#15

Tested locally on QGIS 3.40.5 (macOS) by running the TARGET algorithm through the actual Processing Toolbox GUI with target-py 0.2.0 installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strange error (only sometimes) in TARGET

1 participant