Bug report #16756

Updated by Jürgen Fischer over 6 years ago

Since this commit:14ab5eb0bda9a5993b9ab15a3b7de1af9df8dcba commit : https://github.com/qgis/QGIS/commit/14ab5eb0bda9a5993b9ab15a3b7de1af9df8dcba

I get this error when trying to import data via 'cadastre' module in a PostGIS database :

<pre>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 104: ordinal not in range(128)
Traceback (most recent call last):
File "C:/Users/julien.sabatier/.qgis2/python/plugins\cadastre\cadastre_dialogs.py", line 1090, in processImport
qi.importMajic()
File "C:/Users/julien.sabatier/.qgis2/python/plugins\cadastre\cadastre_import.py", line 419, in importMajic
self.executeSqlScript(s, False, item.has_key('constraints'))
File "C:/Users/julien.sabatier/.qgis2/python/plugins\cadastre\cadastre_import.py", line 1064, in executeSqlScript
self.executeSqlQuery(sql, ignoreError)
File "C:/Users/julien.sabatier/.qgis2/python/plugins\cadastre\cadastre_import.py", line 1115, in executeSqlQuery
c = self.connector._execute_and_commit(sql)
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\db_manager\db_plugins\connector.py", line 95, in _execute_and_commit
self._execute(None, sql)
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\db_manager\db_plugins\connector.py", line 81, in _execute
cursor.execute(str(sql))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 104: ordinal not in range(128)



Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
Version de QGIS : 2.18.10 Las Palmas, 59e0f78
</pre>

It look like the use of the str function in the connector create this error.

Have you some solution to fix this ? Is it a configuration problem with my environment ?
I tried both on a Debian and Windows platform and each time with the 2.18 version of QGis I have this error.

Back