Bug report #15543

Wrong Unicode handling of metadata plugin fields

Added by Andrés V. O. about 8 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Unknown
Affected QGIS version:2.16.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:23466

Description

Hi there:

In QGIS versions 2.16 and above on Windows 10, the description field of the general section of metadata.txt seems not to be properly decoded if it contains UTF-8 characters.

Please, find attached two versions of plugin SEC4QGIS . Version 1.0.2 has an Unicode character at the description, which causes QGIS (if version >= 2.16) to crash when you run it after installing the plugin. I mean, you have to install the v1.0.2 plugin, run QGIS, close QGIS, and run QGIS again. This is the error message I get after that sequence:

An error occurred during execution of following code:
import pyplugin_installer
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xf3' in position 36: ordinal not in range(128)
Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version:
2.16.2 'Nødebo', 979e1a2

And after clicking Close then this window appears next:

An error occurred during execution of following code:
pyplugin_installer.initPluginInstaller()
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'pyplugin_installer' is not defined
Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version:
2.16.2 'Nødebo', 979e1a2

If you try SEC4QGIS v1.0.3 it will run without problems, and the only difference between both versions (apart from the PDF help file) is on metadata.txt.

Curiously enough, this bug does not affect some other fields like about, which also contains Unicode characters on both versions of the plugin.

It does not affect version 2.14 either.

SEC4QGIS.v1.0.2.zip - SEC4QGIS plugin v1.0.2 (971 KB) Andrés V. O., 2016-09-07 10:18 AM

SEC4QGIS.v1.0.3.zip - SEC4QGIS plugin v1.0.3 (971 KB) Andrés V. O., 2016-09-07 10:18 AM

History

#1 Updated by Andrés V. O. about 8 years ago

Just a quick update:

I've found this bug on QGIS versions 2.16.1 and 2.16.2 on Windows 10.

Than you very much.

Best regards.

#2 Updated by Adam Szieberth about 8 years ago

I can confirm this on 2.16.3 and Windows XP.

My plugin had unicode characters not in description but in about and changelog.

#3 Updated by Giovanni Manghi almost 8 years ago

  • Priority changed from Normal to High

#4 Updated by Giovanni Manghi over 7 years ago

  • Priority changed from High to Normal
  • Status changed from Open to Closed
  • Crashes QGIS or corrupts data changed from Yes to No
  • Resolution set to not reproducable

The attached plugins works without any issue in 2.18.4. Please reopen if necessary.

#5 Updated by Jürgen Fischer about 7 years ago

  • Category set to Unknown

Also available in: Atom PDF