codesign py2app bundle format unrecognized, invalid, or unsuitable

Error code 1 "bundle format unrecognized, invalid, or unsuitable"

Yea, I'm trying to codesign a python app which has been bundled with py2app, but without success.

The codesign process logs a whole bunch of files with the above error.

def sign_file(file_path, certificate_common_name, hardened_runtime=False):
    sign_command = [
        "codesign", "-s", certificate_common_name,
        "--force", "--timestamp", "-v", file_path
    ]
    if hardened_runtime:
        sign_command.append("--options=runtime")
    
    success, message = run_command(sign_command)

there are literally hundreds of files that fail, and the path may look something like this;

code/dist/Impulse.app/Contents/Resources/lib/python3.10/plotly/validators/splom/marker:

Needless to say that notorization returns "failed"

Any help would be greatly appreciated.

Steven

Answered by DTS Engineer in 791978022
how is it that I cant edit my post???

DevForums only lets you edit a post for a short time after writing it.

Coming back to your technical question, when using third-party tooling, it’s best to follow the advice for that tooling. If the tooling doesn’t offer any advice, we have general instructions in:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Oops code block above was missing the last few lines.

(new to this forum, how is it that I cant edit my post???)

    sign_command = [
        "codesign", "-s", certificate_common_name,
        "--force", "--timestamp", "-v", file_path
    ]
    if hardened_runtime:
        sign_command.append("--options=runtime")
    
    success, message = run_command(sign_command)
    
    if success:
        verify_command = ["codesign", "--verify", "--verbose=4", file_path]
        success, verify_message = run_command(verify_command)
        return success, message + verify_message
    else:
        return success, message
how is it that I cant edit my post???

DevForums only lets you edit a post for a short time after writing it.

Coming back to your technical question, when using third-party tooling, it’s best to follow the advice for that tooling. If the tooling doesn’t offer any advice, we have general instructions in:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I think I have done everything humanly possible and with support of ChatGPT also inhumanly possible...., but I have not been able to notorize my impulse.app.

When I follow the standard signing procedure as follows, notorization fails and tells me that the binaries have not been signed.

Sign impulse.app/Contents/Frameworks Sign impulse.app/Contents/MacOs Sign impulse.app/Contents/resources

Sign Impulse.app

Create impulse.dmg

Sign impulse.dmg

...but when I sign all the binaries, which takes around 2 hours, I get an error when attempting to create the dmg file, insufficient disk space, yet there is enough disk space.

So I seem to be in a no win situation.

Any help would be appreciated...

Please post the full notary log. See Fetching the Notary Log for info on how to get that. Post it as an attachment, rather than as inline text. To do that, you’ll have to change the extension to .txt.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

codesign py2app bundle format unrecognized, invalid, or unsuitable
 
 
Q