Crash on importing .obj including "é" (os.py line 823 : UnicodeDecodeError :'utf-8' codec can't decode byte 0xe9) #67987

Closed
opened 2019-07-31 11:00:57 +02:00 by rudy · 12 comments

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: af4dcc6073, 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 : https://stackoverflow.com/questions/32170913/scrapyunicodedecodeerror-ascii-codec-cant-decode-byte-0xe9-in-position-1-o

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

BlenderCrash.PNG

**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 : https://stackoverflow.com/questions/32170913/scrapyunicodedecodeerror-ascii-codec-cant-decode-byte-0xe9-in-position-1-o Unfortunatly, I can provide the .OBJ file since it is proprietary. ![BlenderCrash.PNG](https://archive.blender.org/developer/F7639243/BlenderCrash.PNG)
Author

Added subscriber: @delcroit79

Added subscriber: @delcroit79

blender/blender-addons#73225 was marked as duplicate of this issue

blender/blender-addons#73225 was marked as duplicate of this issue

Added subscribers: @mont29, @rjg

Added subscribers: @mont29, @rjg

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?

@mont29 again something for you to look at?

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? @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.

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

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2019-07-31 15:27:23 +02:00

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.

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.
Author

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
rudy reopened this issue 2019-08-01 13:22:37 +02:00
Author

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
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 ```

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

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

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

Added subscriber: @marcossou

Added subscriber: @marcossou
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 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#67987
No description provided.