Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#25948] blender-thumbnailer.py does incorrect checking for the number of arguments

Date:
2011-02-06 05:57
Priority:
3
State:
Closed
Submitted by:
Shinsuke Irie (irie)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Python
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
blender-thumbnailer.py does incorrect checking for the number of arguments
Detailed description
blender-thumbnailer.py needs two arguments <input.blend> and <output.png>, so if calling it with no argument, it shows error message as:

$ release/bin/blender-thumbnailer.py
Expected 2 arguments <input.blend> <output.png>
$

I noticed, however, it doesn't show the error message if only one argument is given.

Please modify it like below:

--- blender/release/bin/blender-thumbnailer.py (revision 34646)
+++ blender/release/bin/blender-thumbnailer.py (working copy)
@@ -118,7 +118,7 @@
if __name__ == '__main__':
import sys

- if len(sys.argv) < 2:
+ if len(sys.argv) < 3:
print("Expected 2 arguments <input.blend> <output.png>")
else:
file_in = sys.argv[-2]

Followup

Message
  • Date: 2011-02-06 07:54
  • Sender: Campbell Barton
  • thanks for the fix, applied r34665.
 

Attached Files:

No Files Currently Attached

Changes:

Field Old Value Date By
close_dateNone2011-02-06 07:54campbellbarton
assigned_tonone2011-02-06 07:54campbellbarton
StatusNew2011-02-06 07:54campbellbarton
status_idOpen2011-02-06 07:54campbellbarton