Author Topic: return code  (Read 1239 times)


  • Jr. Member
  • **
  • Posts: 51
    • View Profile return code
« on: May 07, 2018, 08:46:58 PM »
While doing python scripting on Ubuntu 16.04 with photoscan 1.4.1, I've noticed always returns 0 even when my script raises an exception. My solution is to explicitly call sys.exit(1) within my script, which causes to return 1. But I'm not sure if it's safe to call sys.exit directly--does this prevent PhotoScan from cleaning up?

To be precise, here are two example scripts:
Code: [Select]
raise RuntimeError("error!")
Code: [Select]
import sys

...and when I run them:
Code: [Select]
python # returns 1 -platform offscreen -r # returns 0

python # returns 1 -platform offscreen -r # returns 1

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14110
    • View Profile
Re: return code
« Reply #1 on: May 13, 2018, 02:44:43 PM »
Hello william,

We will fix exit code issue in the version 1.4.3.

The workaround that you are using could result in remaining temporary files in the project folder (for PSX format).
Best regards,
Alexey Pasumansky,
Agisoft LLC