OSX: Command line switch -- disables ability to use python arguments beginning with -h #56092

Closed
opened 2018-07-24 19:01:30 +02:00 by Jon Hammer · 10 comments

System Information
OSX 10.13.5

Blender Version
Broken: 2.79b f4dc9f9
Worked: N/A

Short description of error
The documentation for the command line argument -- says that any arguments that appear afterwards are ignored. This isn't currently strictly true. Any additional argument that begins with the string -h will be seen as a request for Blender's help screen, rather than being passed directly to the Python script. For example:

/Applications/Blender/blender.app/Contents/MacOS/blender --python some_script.py -- -height

produces the following output:

Read prefs: /Users/jch002j/Library/Application Support/Blender/2.79/config/userpref.blend
found bundled python: /Applications/Blender/blender.app/Contents/Resources/2.79/python
usage: blender [-h]
               [--cycles-resumable-num-chunks CYCLES_RESUMABLE_NUM_CHUNKS]
               [--cycles-resumable-current-chunk CYCLES_RESUMABLE_CURRENT_CHUNK]
               [--cycles-resumable-start-chunk CYCLES_RESUMABLE_START_CHUNK]
               [--cycles-resumable-end-chunk CYCLES_RESUMABLE_END_CHUNK]
blender: error: argument -h/--help: ignored explicit argument 'eight'

This effectively prevents any python script from using arguments that begin with -h, which is an unusual scripting limitation. Ideally, Blender would actually ignore these arguments, allowing the python script to continue.

Exact steps for others to reproduce the error

/Applications/Blender/blender.app/Contents/MacOS/blender -- -height
**System Information** OSX 10.13.5 **Blender Version** Broken: 2.79b f4dc9f9 Worked: N/A **Short description of error** The documentation for the command line argument `--` says that any arguments that appear afterwards are ignored. This isn't currently strictly true. Any additional argument that begins with the string `-h` will be seen as a request for Blender's help screen, rather than being passed directly to the Python script. For example: ``` /Applications/Blender/blender.app/Contents/MacOS/blender --python some_script.py -- -height ``` produces the following output: ``` Read prefs: /Users/jch002j/Library/Application Support/Blender/2.79/config/userpref.blend found bundled python: /Applications/Blender/blender.app/Contents/Resources/2.79/python usage: blender [-h] [--cycles-resumable-num-chunks CYCLES_RESUMABLE_NUM_CHUNKS] [--cycles-resumable-current-chunk CYCLES_RESUMABLE_CURRENT_CHUNK] [--cycles-resumable-start-chunk CYCLES_RESUMABLE_START_CHUNK] [--cycles-resumable-end-chunk CYCLES_RESUMABLE_END_CHUNK] blender: error: argument -h/--help: ignored explicit argument 'eight' ``` This effectively prevents any python script from using arguments that begin with `-h`, which is an unusual scripting limitation. Ideally, Blender would actually ignore these arguments, allowing the python script to continue. **Exact steps for others to reproduce the error** ``` /Applications/Blender/blender.app/Contents/MacOS/blender -- -height ```
Author

Added subscriber: @jhammer

Added subscriber: @jhammer
Campbell Barton changed title from Command line switch -- disables ability to use python arguments beginning with -h to OSX: Command line switch -- disables ability to use python arguments beginning with -h 2018-07-27 07:20:46 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Can't redo this in Linux, looks like an OSX only issue?

Can't redo this in Linux, looks like an OSX only issue?

Added subscribers: @ArtoKitula, @brecht, @mont29

Added subscribers: @ArtoKitula, @brecht, @mont29
Brecht Van Lommel was assigned by Bastien Montagne 2018-07-27 10:13:06 +02:00

@brecht, @ArtoKitula , mind checking that one? Thanks.

@brecht, @ArtoKitula , mind checking that one? Thanks.

Confirmed.

Confirmed.

This issue was referenced by blender/cycles@6f973c4821

This issue was referenced by blender/cycles@6f973c4821018ae9647a8600ce1c4db79bb6a389

This issue was referenced by blender/blender@9a080d2ea6

This issue was referenced by blender/blender@9a080d2ea6065b3686089c156cfa72d29744c953

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

It was actually a Cycles issue due to blender/blender@f8b9f4e9bb.

It was actually a Cycles issue due to blender/blender@f8b9f4e9bb.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 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#56092
No description provided.