Maniphest T49735

Blender dysplays garbage when EnumProperty contains string with unicode symbols and "str(number)"
Closed, Archived

Assigned To
Brecht Van Lommel (brecht)
Authored By
Valdas (Zmogas)
Oct 15 2016, 6:43 PM
Tags
  • BF Blender
  • Add-ons (Community)
  • Add-ons (BF-Blender)
Subscribers
Brecht Van Lommel (brecht)
Valdas (Zmogas)

Description

Try to use mine addon

which I stripped down.
When I use mentioned addon then Blender in file selector window displays dropdown list with some random text:

I get correct text in dropdown when I remove all unicode letters in line #25:

		return ('0', 'b'+str(value), 'c'),('q', 'w', 'e')

Also I get correct text when I remove conversion from int to str:

		return ('0', 'Šb', 'c'),('q', 'w', 'e')

System Information
4.4.0-38-generic; 64 bit; Kubuntu 16.04
also

generated by Blender

P.S. sorry for my bad English

Event Timeline

Valdas (Zmogas) created this task.Oct 15 2016, 6:43 PM
Brecht Van Lommel (brecht) changed the task status from Unknown Status to Unknown Status.Oct 15 2016, 10:24 PM
Brecht Van Lommel (brecht) claimed this task.
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

Thanks for the report. This is a known issue documented in the API here, you must manually store a reference to the string somewhere:
https://www.blender.org/api/blender_python_api_2_78_0/bpy.props.html#bpy.props.EnumProperty