Tortoise HG crashes when opened from Launchpad on OSX 10.9

Create issue
Issue #3437 closed
Former user created an issue

After downloading the OSX build, opening the zipfile and running the .app the initial first time, Tortoise HG opens as intended.

Once closed, and ran again, it crashes every time. Same goes for installing the application to Applications or the Launchpad.

This occurs with the nightly stable builds as of 24 oct. It did not occur in 10.8.

Comments (38)

  1. Miguel Tomas

    I have exactly the same problem. I have to unzip every time I want to commit/push/pull. If I close tortoiseHG and opened again on OSX Mavericks it crashes with this error:

    31/10/13 10:27:04,691 thg[2872]: TortoiseHg Error

    31/10/13 10:27:06,028[162]: (org.pythonmac.tortoisehg.thg.48080[2872]) Exited with code: 255

    31/10/13 10:27:06,091 Console[2876]: setPresentationOptions called with NSApplicationPresentationFullScreen when there is no visible fullscreen window; this call will be ignored.

  2. Mats Larsson

    I got exactly same problem. It works just first time, then I get the "TortoiseHg Error".

    So I cannot run Tortoisehg on Mavericks. Please fix this.

    Best regards

  3. Pavel Sorokin

    I'm having the same issue. Software is unusable.

    Also, on retina, every window of the TortoiseHg UI seems to support retina (all fonts are clear), except probably the most important window: change log. It's very pixelated and almost unreadable.

  4. Paolo Boni

    I see that copying again the app extracted from a fresh zip into the Application folder, you can run it once again. Not really a solution, but a possibility to use anyway the application on our Mavericks

  5. Ratnesh Chandna

    Same here. I'm using Mavericks and I tried opening the earliest nightly build available (May 21 2013) and face the same issue. Having said that, it doesn't seem like a regression problem, but an OS compatibility issue instead.

    Either way, when can we expect a fix?

  6. jake_fisher

    So not a final solution by any means but:

    You can use the 'Automator'

    1. Select the 'Run Shell Script' Action
    2. In the dialog provided paste '/Applications/ &'
    3. Run the automator script to test
    4. Save it as a .app file and put it in Applications
    5. As a bonus you can use the following to copy the original app icon to your new app Changing App Icons

    yeah its a hack sorry :-(

  7. Karen McCrann

    I tried this work around but it didnt work - nothing is happening whne i run the newly created app. any tips?

  8. Andre Rudlaff

    It seems that the root issue is that argv emulation is broken with py2app in Mavericks. See

    So I've created a small hack which disables argv emulation completely and updated the file, so it does no longer try to access the arguments.

    You can get it from here

    Copy both files into your and it should work again. However I do not know what side effects it may have if argv emulation is disabled (you may not be able to start the app with command line parameters?)

    I've tested this with the latest stable build (2013-12-03) available from

  9. Gal Schwimmer

    Andre Rudlaff, I've just tested your hack using latest stable build (2013-12-03) and it works great.


  10. Yuya Nishihara

    thg: remove the -psn argument supplied by launchd only if present (refs #3437)

    Prior to OS X 10.9, when launching an app from Finder, launchd would provide an argument starting with "-psn", like this: "-psn_0_261532". This is the process serial number - a vestige from 2001, to support older apps that used cooperative multitasking. In OS X 10.9, Apple changed this, so launchd no longer sends the parameter. Thg assumed that there was always two arguments - the first being the name of the app, and the second starting with "-psn". The fix: just make sure argv has at least one element before checking if argv[0] starts with "-psn".

    → <<cset 3761007d0e72>>

  11. Andre Rudlaff

    I've built a new version, based on the latest TortoiseHG release (2.11.2).

    You can get the version here:

    I am only able to test this on Mavericks, so I'd appreciate any feedback if the app is working on older versions of OS X.

    I'd still consider this a BETA release, so don't throw away your old application files, and let me know if you have any issues with this version. :)

    For issues/feedback, check!topic/thg-dev/maaoY_-n6uc

  12. Laurens Holst

    Thanks for providing these builds. It seems to work well.

    One thing I noticed, when I use nonascii characters I get the following message:

    Unable to translate message to local encoding
    Consider setting HGENCODING environment variable
    Replace untranslatable characters with "?"?

    When I start this TortoiseHg build from the command line however, as well as with the old OS X builds, I can use nonascii characters without problems. Is the environment encoding (LANG=nl_NL.UTF-8) not set up correctly by the launcher wrapper?

  13. Andre Rudlaff

    I have updated the version, so it sets the proper environment. The LANG environment variable is only set by the terminal app and is not included in the environment provided to the app bundle.

    I have added pyobjc to get the users locale (i.e. de_DE or nl_NL) however I didn't find a way to detect the proper encoding to use (the terminal app settings provide a dropdown box for this), so I have hardcoded this to UTF-8.

    You should still be able to set the HGENCODING variable in case you need to override this behaviour.

    The version is available here:

    Note: this also fixes a crash when merging files, again this seems to be introduced by the py2app environment.

    EDIT Just updated the file again, I disabled the optimization and argv emulation in the py2app setup script, and I finally could remove the hacks I've introduced for dialogs and merging files.

    So I'd consider this version a pretty good release candidate. Note that I still test on OSX 10.9 only.

  14. Mike Leach

    Many thanks for your work, Andre! I've been using your version above in the interim until an official new OS X installer is available.

  15. Andre Rudlaff

    Sorry for the delay, had some problems with my toolchain setup (i.e. had to recreate it) and very little time to do so.

    Hopefully now everything works again, I'm currently uploading the 3.2.1 build.

  16. Marc Schlaich

    @Weeds2000 is there somewhere a build script? Would be really interested in how you build the *.app. Thanks a lot!

  17. Log in to comment