Sapling tree gen error when objects have åäö in the name #51157

Closed
opened 2017-04-08 15:43:22 +02:00 by Novice · 16 comments

System Information
Windows 10 Home (Swedish language)
GTX 1070

Blender Version
Broken: 2.78c
Worked: 2.77a (on windows 7)

Short description of error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x85 in position 3: invalid start byte

Exact steps for others to reproduce the error
Start blender. Rename default cube to Låda (any name with lowercase åäö will do). User preferences->Addons-> Add Curve: Sapling Tree Gen.
Shift-A->Curve->Sapling Tree Gen.

blender_sapling_error.png
blender_sapling_error.blend

**System Information** Windows 10 Home (Swedish language) GTX 1070 **Blender Version** Broken: 2.78c Worked: 2.77a (on windows 7) **Short description of error** UnicodeDecodeError: 'utf-8' codec can't decode byte 0x85 in position 3: invalid start byte **Exact steps for others to reproduce the error** Start blender. Rename default cube to Låda (any name with lowercase åäö will do). User preferences->Addons-> Add Curve: Sapling Tree Gen. Shift-A->Curve->Sapling Tree Gen. ![blender_sapling_error.png](https://archive.blender.org/developer/F539517/blender_sapling_error.png) [blender_sapling_error.blend](https://archive.blender.org/developer/F539519/blender_sapling_error.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @BlenderAmateur

Added subscriber: @BlenderAmateur
Aaron was assigned by Aaron Carlisle 2017-04-08 20:04:49 +02:00

I was able to replicate this, but inconsistently. Can anyone confirm if this is a blender issue or something addons need to handle themselves. If it's the addon then how do I fix it?, because I do not know what's causing this.

I was able to replicate this, but inconsistently. Can anyone confirm if this is a blender issue or something addons need to handle themselves. If it's the addon then how do I fix it?, because I do not know what's causing this.
Member

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @bliblubli

Added subscriber: @bliblubli

@Abpy Blender and Python both can handle UTF-8 correctly. But maybe see https://developer.blender.org/T50926, because python on windows by default doesn't use UTF-8 encoding everywhere.

@Abpy Blender and Python both can handle UTF-8 correctly. But maybe see https://developer.blender.org/T50926, because python on windows by default doesn't use UTF-8 encoding everywhere.
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy
Member

hi, I was under the impression that py does not handle special text characters.
possibly we could add the unicode block to the addon?
https://wiki.blender.org/index.php/Dev:Doc/Code_Style says to avoid special characters

hi, I was under the impression that py does not handle special text characters. possibly we could add the unicode block to the addon? https://wiki.blender.org/index.php/Dev:Doc/Code_Style says to avoid special characters
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

@BrendonMurphy that is in the code, not as a user.

@BrendonMurphy that is in the code, not as a user.
Member

@Blendify, I'll seek clarify adding priority normal,

@Blendify, I'll seek clarify adding priority normal,

I have a workaround that uses base64 to pass the string through the addon. It lets you choose the objects but still doesn't show the correct object name in the menu.

I have a workaround that uses base64 to pass the string through the addon. It lets you choose the objects but still doesn't show the correct object name in the menu.
Member

hi testing this (following exact reproduce from op) I was able to get the error using the presets & also in ui.
adding

# -*- coding: utf-8 -*-

to the file header (line1) in init.py & utils.py
& I cannot reproduce the issue

will commit fix soon

hi testing this (following exact reproduce from op) I was able to get the error using the presets & also in ui. adding ``` # -*- coding: utf-8 -*- ``` to the file header (line1) in __init__.py & utils.py\ & I cannot reproduce the issue will commit fix soon

This issue was referenced by ba6a119db2

This issue was referenced by ba6a119db23a04dadf52c7f46bc4c62926c60625
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

awesome, I didn't know file encodings could cause things like this. Its a lot better than my ugly workaround. thanks.

awesome, I didn't know file encodings could cause things like this. Its a lot better than my ugly workaround. thanks.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#51157
No description provided.