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

GDAL processing provider: "FutureWarning: Neither ogr.UseExceptions() nor ogr.DontUseExceptions() has been explicitly called" warning #57344

Closed
2 tasks done
agiudiceandrea opened this issue May 5, 2024 · 0 comments · Fixed by #57477
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented May 5, 2024

What is the bug or the crash?

During the execution of GDAL/OGR processing algorithms (on system where QGIS uses GDAL version >= 3.7) the following warning message is displayed in the "Python warning" tab of the "Log Messages" panel:

WARNING    warning:C:\OSF9FA~1\apps\Python312\Lib\site-packages\osgeo\ogr.py:593: FutureWarning: Neither ogr.UseExceptions() nor ogr.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.
              warnings.warn(
             
             traceback: File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 132, in processAlgorithm
              commands = self.getConsoleCommands(parameters, context, feedback, executing=True)
              File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\gdal\Buffer.py", line 103, in getConsoleCommands
              ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing)
              File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 89, in getOgrCompatibleSource
              ogr_layer_name = GdalUtils.ogrLayerName(ogr_data_path)
              File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 439, in ogrLayerName
              ds = ogr.Open(basePath)
              File "C:\OSF9FA~1\apps\Python312\Lib\site-packages\osgeo\ogr.py", line 7462, in Open
              _WarnIfUserHasNotSpecifiedIfUsingExceptions()
              File "C:\OSF9FA~1\apps\Python312\Lib\site-packages\osgeo\ogr.py", line 593, in _WarnIfUserHasNotSpecifiedIfUsingExceptions
              warnings.warn(

Steps to reproduce the issue

  1. execute the GDAL "Buffer vectors" processing algorithm
  2. see the warning message in the "Python warning" tab of the "Log Messages" panel

Versions

QGIS version
3.36.2-Maidenhead
QGIS code revision
6d25052
Qt version
5.15.13
Python version
3.12.3
GDAL/OGR version
3.8.5
PROJ version
9.4.0
EPSG Registry database version
v11.004 (2024-02-24)
GEOS version
3.12.1-CAPI-1.18.1
SQLite version
3.45.1
PDAL version
2.6.3
PostgreSQL client version
16.2
SpatiaLite version
5.1.0
QWT version
6.2.0
QScintilla2 version
2.14.1
OS version
Windows 10 Version 1903

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@agiudiceandrea agiudiceandrea added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 5, 2024
@rouault rouault self-assigned this May 17, 2024
rouault added a commit to rouault/QGIS that referenced this issue May 19, 2024
rouault added a commit to rouault/QGIS that referenced this issue May 19, 2024
rouault added a commit to rouault/QGIS that referenced this issue May 20, 2024
rouault added a commit to rouault/QGIS that referenced this issue May 20, 2024
rouault added a commit to rouault/QGIS that referenced this issue May 20, 2024
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! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants