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

TypeError: _log() got an unexpected keyword argument 'stacklevel' #172

Closed
cymed opened this issue Feb 22, 2024 · 5 comments
Closed

TypeError: _log() got an unexpected keyword argument 'stacklevel' #172

cymed opened this issue Feb 22, 2024 · 5 comments
Assignees
Labels
bug Something isn't working INTERLIS About INTERLIS exchange format (import / export)

Comments

@cymed
Copy link
Contributor

cymed commented Feb 22, 2024

On an Interlis Export, I got the error:

File "%QGSPath%\profiles\tww_prod/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 386, in export_organisation
bemerkung=self.truncate(self.emptystr_to_null(row.remark), 80),
File "%QGSPath%\profiles\tww_prod/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 2364, in truncate
logger.warning(f"Value '{val}' exceeds expected length ({max_length})", stacklevel=2)
File "C:\OSGeo4W\apps\Python39\lib\logging_init
.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'stacklevel'

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS-Version: 3.28.11-Firenze Firenze, b02458a196
logging.version: 0.5.1.2

@sjib
Copy link
Contributor

sjib commented Mar 6, 2024

I get the same problem:

`Ein Fehler trat bei der Ausführung von Python-Code auf:

TypeError: _log() got an unexpected keyword argument 'stacklevel'
Traceback (most recent call last):
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\teksi_wastewater_plugin.py", line 470, in actionExportClicked
self.interlisImporterExporter.action_export()
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter_gui.py", line 140, in action_export
raise exception
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter_gui.py", line 111, in action_export
self.interlis_importer_exporter.interlis_export(
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_importer_exporter.py", line 170, in interlis_export
self._export_to_intermediate_schema(
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_importer_exporter.py", line 321, in _export_to_intermediate_schema
twwInterlisExporter.tww_export()
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 74, in tww_export
raise exception
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 69, in tww_export
self._export()
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 84, in _export
self._export_sia405_abwasser()
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 150, in _export_sia405_abwasser
self._export_organisation()
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 448, in export_organisation
bemerkung=self.truncate(self.emptystr_to_null(row.remark), 80),
File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 2395, in truncate
logger.warning(f"Value '{val}' exceeds expected length ({max_length})", stacklevel=2)
File "C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\logging_init
.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'stacklevel'

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS-Version: 3.28.4-Firenze Firenze, fd0fb72ab3

Python-Pfad:
C:/PROGRA1/QGIS 3.28.4/apps/qgis-ltr/./python
C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python
C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins
C:/PROGRA
1/QGIS 3.28.4/apps/qgis-ltr/./python/plugins
C:\Program Files\QGIS 3.28.4\bin\python39.zip
C:\PROGRA1\QGIS 3.28.4\apps\Python39\DLLs
C:\PROGRA
1\QGIS 3.28.4\apps\Python39\lib
C:\Program Files\QGIS 3.28.4\bin
C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages
C:\PROGRA1\QGIS 3.28.4\apps\Python39
C:\PROGRA
1\QGIS 3.28.4\apps\Python39\lib\site-packages
C:\PROGRA1\QGIS 3.28.4\apps\Python39\lib\site-packages\win32
C:\PROGRA
1\QGIS 3.28.4\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\site-packages\Pythonwin
C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python
C:/Daten/QGEP/testing_dss2020/20240305
C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\tww_testing/python/plugins\teksi_wastewater\interlis\gui....
.`

@sjib sjib added bug Something isn't working INTERLIS About INTERLIS exchange format (import / export) labels Mar 6, 2024
@sjib
Copy link
Contributor

sjib commented Mar 6, 2024

@ponceta Can you check with opengis about this?

@domi4484 domi4484 self-assigned this Mar 26, 2024
@domi4484
Copy link
Contributor

I pushed by mistake the fix directly to main. Can someone review the changes in commit c148d7b?

@sjib
Copy link
Contributor

sjib commented Mar 29, 2024

@domi4484 Thanks for the fix.
I get now an error while exporting reach_progression_alternative - see #188
Can you check on this?

@sjib
Copy link
Contributor

sjib commented Mar 29, 2024

@domi4484 And also get an error about the length of TID's for *_Text classes - see #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working INTERLIS About INTERLIS exchange format (import / export)
Projects
None yet
Development

No branches or pull requests

3 participants