Python traceback when importing .obj file #90846

Open
opened 2021-08-22 12:44:28 +02:00 by brunnerh · 9 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14830 Core Profile Context 21.4.1 27.20.21002.112

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-21 21:31, hash: blender/blender@721fad37a1
Worked: Unknown, behaves the same in 2.93.1

Short description of error
If a valid file has been auto-filled or entered in the file name input, this file will be used. If nothing has been entered or the name is invalid you can get various errors, e.g. for .obj import you get a stack trace:

image.png

Exact steps for others to reproduce the error

  • Open default scene
  • File -> Import -> Wavefront (.obj)
  • Keep the file name field empty
  • Click Import
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14830 Core Profile Context 21.4.1 27.20.21002.112 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-21 21:31, hash: `blender/blender@721fad37a1` Worked: Unknown, behaves the same in 2.93.1 **Short description of error** If a valid file has been auto-filled or entered in the file name input, this file will be used. If nothing has been entered or the name is invalid you can get various errors, e.g. for `.obj` import you get a stack trace: ![image.png](https://archive.blender.org/developer/F10304515/image.png) **Exact steps for others to reproduce the error** - Open default scene - File -> Import -> Wavefront (.obj) - Keep the file name field empty - Click Import
Author

Added subscriber: @brunnerh

Added subscriber: @brunnerh

#94638 was marked as duplicate of this issue

#94638 was marked as duplicate of this issue
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

If nothing has been entered or the name is invalid you can get various errors,

Can reproduce on master:

File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj_init_.py", line 146, in execute
return import_obj.load(context, **keywords)
File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj\import_obj.py", line 976, in load
float_func = get_float_func(filepath)
File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj\import_obj.py", line 883, in get_float_func
file = open(filepath, 'rb')

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Pratik\\Documents\\'

location: <unknown location>:-1

it will execute "Open"/"Import" etc. (depending on type of dialog).

I am not able to reproduce this. did you try with factory settings?: File -> Defaults -> Load factory settings

>If nothing has been entered or the name is invalid you can get various errors, Can reproduce on master: ```Python: Traceback (most recent call last): ``` File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj\__init__.py", line 146, in execute return import_obj.load(context, **keywords) File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj\import_obj.py", line 976, in load float_func = get_float_func(filepath) File "C:\Users\Pratik\Desktop\BlenderOSP\2019_lite_ninja\bin\3.0\scripts\addons\io_scene_obj\import_obj.py", line 883, in get_float_func file = open(filepath, 'rb') ``` FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Pratik\\Documents\\' location: <unknown location>:-1 ``` > it will execute "Open"/"Import" etc. (depending on type of dialog). I am not able to reproduce this. did you try with factory settings?: `File -> Defaults -> Load factory settings`
Author

Oh, you are right, maybe the defaults changed and my key bindings retained the faulty setting (i don't think i ever changed anything about the file browser keys).
Had double click bound to file.execute whereas now the default is file.mouse_execute.

If the OBJ importer showing an error like that is considered fix worthy, this bug could be adjusted accordingly.

Oh, you are right, maybe the defaults changed and my key bindings retained the faulty setting (i don't think i ever changed anything about the file browser keys). Had double click bound to `file.execute` whereas now the default is `file.mouse_execute`. If the OBJ importer showing an error like that is considered fix worthy, this bug could be adjusted accordingly.
Member

If the OBJ importer showing an error like that is considered fix worthy, this bug could be adjusted accordingly.

Yes, will edit the report accordingly. I don't see any other similar report, so confirming.

>If the OBJ importer showing an error like that is considered fix worthy, this bug could be adjusted accordingly. Yes, will edit the report accordingly. I don't see any other similar report, so confirming.
Pratik Borhade changed title from Double click on empty space in file browser invokes confirmation to Python traceback when importing .obj file 2021-08-23 08:17:14 +02:00
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can reproduce with a few other importers (eg. Motion capture, Scalable vector graphics, Stanford, stl)

Adding #add-ons_bf-blender tag since this does not happen with every option.

Can reproduce with a few other importers (eg. Motion capture, Scalable vector graphics, Stanford, stl) Adding #add-ons_bf-blender tag since this does not happen with every option.
Member

Added subscribers: @arieffmashaf96, @iss, @StephenSwaney

Added subscribers: @arieffmashaf96, @iss, @StephenSwaney
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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#90846
No description provided.