Skip to content
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

processing.algorithmHelp from terminal (outside QGIS desktop) #37524

Closed
FrancoisChaumont opened this issue Jul 1, 2020 · 3 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers Processing Relating to QGIS Processing framework or individual Processing algorithms stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@FrancoisChaumont
Copy link

Describe the bug

No matter which provider:algorithm algorithmHelp is trying to display details for it seems to encounter the same issue when running from terminal outside of QGIS desktop.

Here below is the output for processing.algorithmHelp("native:creategrid"):

Create grid (native:creategrid)
...
CRS: Grid CRS

        Parameter type: QgsProcessingParameterCrs

        Accepted data types:
Traceback (most recent call last):
    ...
    processing.algorithmHelp("native:creategrid")
  File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 75, in algorithmHelp
    print('\n'.join(opts))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 94: ordinal not in range(128)

How to Reproduce

Run the following script:

import os
import sys
import getopt

sys.path.append('/usr/lib/qgis')
sys.path.append('/usr/share/qgis/python/plugins')

from qgis.core import QgsApplication

QgsApplication.setPrefixPath('/usr', True)
app = QgsApplication([], False)
app.initQgis()

from qgis.analysis import QgsNativeAlgorithms
app.processingRegistry().addProvider(QgsNativeAlgorithms())

import processing
from processing.core.Processing import Processing

Processing.initialize()

processing.algorithmHelp("native:creategrid")

app.exitQgis()

QGIS and OS versions

QGIS version 3.14.0-Pi QGIS code revision 9f7028f
Compiled against Qt 5.9.5 Running against Qt 5.9.5
Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3
Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771
Compiled against SQLite 3.22.0 Running against SQLite 3.22.0
PostgreSQL Client Version 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.3 QScintilla2 Version 2.10.2
PROJ.4 Version 493
OS Version Ubuntu 18.04.4 LTS
Active python plugins qgis2web; batch_gps_importer; GpxSegmentImporter; shapetools; clipper; ClipMultipleLayers; QuickOSM; quick_map_services; timemanager; loadthemall; QGIS3-getWKT; GeoCoding; latlontools; qgis_resource_sharing; db_manager; processing; MetaSearch
@FrancoisChaumont FrancoisChaumont added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 1, 2020
@pblottiere
Copy link
Member

I cannot reproduce the issue on ArchLinux.

@gioman gioman added Processing Relating to QGIS Processing framework or individual Processing algorithms Feedback Waiting on the submitter for answers labels Jan 2, 2021
@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 17, 2021
@FrancoisChaumont
Copy link
Author

Issue solved for QGIS 3.16 running on Ubuntu 20.04.

QGIS version 3.16.2-Hannover QGIS code revision f1660f9
Compiled against Qt 5.12.8 Running against Qt 5.12.8
Compiled against GDAL/OGR 3.0.4 Running against GDAL/OGR 3.0.4
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.31.1 Running against SQLite 3.31.1
PostgreSQL Client Version 12.5 (Ubuntu 12.5-0ubuntu0.20.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.11.2
Compiled against PROJ 6.3.1 Running against PROJ Rel. 6.3.1, February 10th, 2020
OS Version Ubuntu 20.04.1 LTS
Active python plugins qgis2web; batch_gps_importer; GpxSegmentImporter; shapetools; clipper; mmqgis; ClipMultipleLayers; QuickOSM; geometry_paster; quick_map_services; timemanager; loadthemall; QGIS3-getWKT; GeoCoding; latlontools; qgis_resource_sharing; CalculateGeometry; CalcArea; db_manager; processing; MetaSearch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers Processing Relating to QGIS Processing framework or individual Processing algorithms stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

3 participants