Page MenuHome

Crash on importing .obj including "é" ( line 823 : UnicodeDecodeError :'utf-8' codec can't decode byte 0xe9)
Closed, InvalidPublic


System Information
Operating system: Win7 64bit.
Graphics card: 'AMD Radeon HD 7400M Series' '4.5.13399 Core Profile Context 15.200.1062.1004'

Blender Version
Broken: 2.81 (sub 0), branch: master, commit date: 2019-07-30 23:47, hash: af4dcc6073fa, type: Release
Worked: 2.79b

Short description of error
I was trying to import a .OBJ file and it crashed on version 2.81 whereas it worked on version 2.79b.

The crash stack is attached but I believe that it is due to an reference with "é" since the designer was french.

This post about "é" and python can provide some background :

Unfortunatly, I can provide the .OBJ file since it is proprietary.



Event Timeline

The file you're trying to import doesn't seem to be encoded by UTF-8 since é would be 0xc3 0xa9. More likely it's ISO-8859-1 (Latin1) which encodes it as 0xe9. Since .obj is specified as ASCII format, any characters that aren't in ASCII should be escape before writing them. Strictly speaking the .obj file is invalid. Since this worked in 2.79b it should probably be looked at anyway. What software was used to create this .obj file?

@Bastien Montagne (mont29) again something for you to look at?

As a work around you can convert the file from ISO-8859-1 to UTF-8 and it should work fine.

Bastien Montagne (mont29) claimed this task.

No file to reproduce, so no chance for us to investigate this... But yeah, I don't how we'd be supposed to handle that kind of issue, since we have no way to guess file encoding... Just convert it to proper utf-8. Not a bug in any case.

rudy (delcroit79) reopened this task as Open.Aug 1 2019, 1:22 PM

Dear All,

I've been able to narrow down the issue.

The problem occurs when there is a .mtl file linked to the .obj. If ever, the .mtl file referes to a texture file (.jpg) and that file is in a directory with a "é"; Blender would crash with the above error message.

See hereafter the .mtl extract :

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 20.06.2019 16:06:31

newmtl 21___Default
	Ns 10.0000
	Ni 1.5000
	d 1.0000
	Tr 0.0000
	Tf 1.0000 1.0000 1.0000 
	illum 2
	Ka 0.5882 0.5882 0.5882
	Kd 0.5882 0.5882 0.5882
	Ks 0.0000 0.0000 0.0000
	Ke 0.0000 0.0000 0.0000
	map_Ka H:\La Cie\Cle USB\Documents\matériaux\LOGO2.JPG
	map_Kd H:\La Cie\Cle USB\Documents\matériaux\LOGO2.JPG

@rudy (delcroit79) Please do not re-open tasks. And I already explained why this is not a bug and something we can do little about.