Skip to content

Info.plist warning: The values of CFBundleTypeName entries must be strings. #7029

Closed

Description

@Moosems

Description of the issue

Getting issue when opening app over info.plist (Application still opens and runs but want to find out how to resolve this issue). I do not believe this issue is directly because of pyinstaller but as the plist is written by pyinstaller I thought I'd ask here for suggestions/help

Context information (for bug reports)

  • Output of pyinstaller --version: 5.2
  • Version of Python: 3.10.4
  • Platform: OS X
  • How you installed Python: python.org/downloads
  • Did you also try this on another platform? No. I don't own any other computers to test from

Make sure everything is packaged correctly

  • start with clean installation
  • use the latest development version
  • Run your frozen program from a command window (shell) — instead of double-clicking on it
  • Package your program in --onedir mode
  • Package without UPX, say: use the option --noupx or set upx=False in your .spec-file
  • Repackage you application in verbose/debug mode. For this, pass the option --debug to pyi-makespec or pyinstaller or use EXE(..., debug=1, ...) in your .spec file.

A minimal example program which shows the error

#Part of the spec file
app = BUNDLE(
    coll,
    info_plist={
        "CFBundleShortVersionString": "1.0.0",
        "CFBundleDocumentTypes": [
            {
                "CFBundleTypeExtensions": ["py", "json", "tcl", "txt"],
                "CFBundleTypeName": ["Python Scripts", "JSON", "Tcl Scripts", "Text"],
                "CFBundleTypeRole": "Editor",
                "CFBundleTypeOSTypes": ["TEXT"],
            },
        ],
    },
    name="exaple.app",
    icon="example.icns",
    bundle_identifier="Example",
)

Packaging: pyinstaller example.spec --windowed

Stacktrace / full error message

Moosems-MacBook-Pro:~ Moosems$ /Users/Moosems/Desktop/DIP-dev/dist/DIP.app/Contents/MacOS/DIP ; exit;
2022-08-15 14:16:03.656 DIP[9860:900469] NSDocumentController Info.plist warning: The values of CFBundleTypeName entries must be strings.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Activity

  1. added
    triagePlease triage and relabel this issue
    on Aug 15, 2022
  2. rokm commented on Aug 15, 2022

    @rokm
    Member

    I do not believe this issue is directly because of pyinstaller but as the plist is written by pyinstaller I thought I'd ask here for suggestions/help

    That's fair reasoning I suppose, but we are not responsible for incorrect data you put into your info_plist dictionary ;)

    CFBundleDocumentTypes needs to be a list of dictionaries where each document type is represented by its own dictionary, in your case:

    #Part of the spec file
    app = BUNDLE(
        coll,
        info_plist={
            "CFBundleShortVersionString": "1.0.0",
            "CFBundleDocumentTypes": [
                {
                    "CFBundleTypeExtensions": ["py", "pyw"],
                    "CFBundleTypeName": "Python Scripts",
                    "CFBundleTypeRole": "Editor",
                    "CFBundleTypeOSTypes": ["TEXT"],
                },
                {
                    "CFBundleTypeExtensions": ["json"],
                    "CFBundleTypeName": "JSON",
                    "CFBundleTypeRole": "Editor",
                    "CFBundleTypeOSTypes": ["TEXT"],
                },
                {
                    "CFBundleTypeExtensions": ["tcl"],
                    "CFBundleTypeName": "Tcl Scripts",
                    "CFBundleTypeRole": "Editor",
                    "CFBundleTypeOSTypes": ["TEXT"],
                },
                {
                    "CFBundleTypeExtensions": ["txt"],
                    "CFBundleTypeName": "Text",
                    "CFBundleTypeRole": "Editor",
                    "CFBundleTypeOSTypes": ["TEXT"],
                }
            ],
        },
        name="exaple.app",
        icon="example.icns",
        bundle_identifier="Example",
    )

    Note how in above example, CFBundleTypeName entries are strings instead of lists.

  3. added and removed
    triagePlease triage and relabel this issue
    on Aug 15, 2022
  4. locked as resolved and limited conversation to collaborators on Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions