-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
accentued caracters make problem to load python expression script #27567
Comments
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Jérôme Seigneuret (Jérôme Seigneuret) This error are caused by encoding file... I have create expression in an old version and I don't understand why but file is in ANSI and not utf-8. I convert encoding with Notepad++ and all work fine. It's possible to add analyse on encoding file if it's not identical to header declaration or/and default encoding?
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Harrissou Santanna (@DelazJ)
L'utilisateur s'appelle base_water_function ou c'est une mauvaise traduction et c'est plutôt le nom de la fonction? |
Author Name: Jérôme Seigneuret (Jérôme Seigneuret) Harrissou Santanna wrote:
Sorry for french resume but I think this is an error of translation same as @Harrissou Il y a peut être une erreur de traduction. En fait je dirais : "Le fichier d'expression utilisateur base_water_function n'est pas valide" File have same name as user expression file listed in fonction (normaly) but there is really a problem because ther is no analyse to check if name are valid or not with file system. I think this message need to be a new issue. \ is a valide expression file name! file stored ... I don't no where because there is no file in folder |
Author Name: Jérôme Seigneuret (Jérôme Seigneuret) I understand why my fucntion don't work When I load function file it is save in local encoding and not in utf-8 so when I reopen it on notepad++ this looks like to that
This comportment is on all scripts... But not all my script contains non ascii caracters. This is the why I don't detect that before
|
Can be closed? |
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". |
While we hate to see this happen, this Issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. |
Author Name: Jérôme Seigneuret (Jérôme Seigneuret)
Original Redmine Issue: 19742
Affected QGIS version: 3.2.2
Redmine category:expressions
Hi,
Error
2018-08-31T15:05:56 WARNING L'expression de l'utilisateur base_water_function n'est pas valide
Traceback (most recent call last):
File "C:/OSGEO4
1/apps/qgis/./python\qgis\user.py", line 48, in load_user_expressions1/apps/qgis/./python\qgis\utils.py", line 674, in _importimport("expressions.{0}".format(name), locals(), globals())
File "C:/OSGEO4
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/user1/AppData/Roaming/QGIS/QGIS3\profiles\default/python\expressions\base_water_function.py", line 21
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 4: invalid continuation byte
Context:
I make a function in expresion script panel and it is used to set label.
The expression script is:
In fact i see
C:\Users\user1\AppData\Roaming\QGIS\QGIS3\profiles\default\QGIS\QGIS3.ini
encoding=UTF-8
there is no information with python but if I have understand, QGIS 3 work with python 3 and default encoding is UTF-8 so I don't understrand
my label call get_pipe_material_code_fr("Material") || (' Ø' ) || "Diameter"
If I go in function panel and click on load, all work fine.
Software information
Version de QGIS
3.2.2-Bonn
Révision du code
2684216
Compilé avec Qt
5.9.2
Utilisant Qt
5.9.2
Compilé avec GDAL/OGR
2.2.4
Utilisé avec GDAL/OGR
2.2.4
Compilé avec GEOS
3.6.1-CAPI-1.10.1
Utilisé avec GEOS
3.6.1-CAPI-1.10.1 r0
Version du client PostgreSQL
9.2.4
Version de SpatiaLite
4.3.0
Version de QWT
6.1.3
Version de QScintilla2
2.10.1
Version de PROJ.4 :
493
The text was updated successfully, but these errors were encountered: