Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1463

Picard crashes on startup on Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1.3
    • 2.1.2
    • None
    • None
    • Windows

      To reproduce:

      1. Setting the display language of Windows 10 to Swedish (installed the Swedish language pack)
      2. AND using attached Picard.ini
      3. AND running Picard installed from installer (I used both official 2.1.2 and custom built installer for current dev version)

      Starting picard.exe from either start menu or command prompt will start the exe and then suddenly crash it before any window is displayed. Output when starting from command prompt:

      c:\Program Files\MusicBrainz Picard>D: 10:05:14,677 tagger._init_:196: Starting Picard from 'c:
      Program Files
      MusicBrainz Picard\\picard
      tagger.pyc'
      D: 10:05:14,677 tagger._init_:198: Platform: Windows-10-10.0.17763-SP0 CPython 3.7.0
      D: 10:05:14,677 tagger._init_:199: Versions: Picard 2.1.3.dev1, Python 3.7.0, PyQt 5.11.3, Qt 5.11.2, Mutagen 1.41.1, Discid discid 1.1.1, libdiscid 0.6.2, astrcmp Python, SSL OpenSSL 1.0.2k  26 Jan 2017
      D: 10:05:14,677 tagger._init_:200: Configuration file path: 'C:/Users/Developer/AppData/Roaming/MusicBrainz/Picard.ini'
      D: 10:05:14,677 tagger._init_:202: User directory: 'C:\\Users\\Developer\\AppData\\Local\\MusicBrainz
      Picard'

      Picard launches perfectly fine even with attached Picard.ini if I set Windows display language to English or German or if I run Picard from source. I also cannot reproduce the behavior with a fresh Picard.ini.

      See:

      https://community.metabrainz.org/t/picard-doesnt-launch-on-windows-10/413644/12

          [PICARD-1463] Picard crashes on startup on Windows

          Upgrading to Python 3.7.2 (from 3.7.0) fixed the issue

          Philipp Wolfer added a comment - Upgrading to Python 3.7.2 (from 3.7.0) fixed the issue

          Some more debugging gave interesting results. Picard crashes when calling `locale.setlocale()` at https://github.com/metabrainz/picard/blob/master/picard/i18n.py#L48 . The process just crashes, no exception or so to catch.

          Adding further logging shows a difference:

          1. When running Picard via tagger.py from source, current_locale gets set to sv_SE.cp1252 and locale.setlocale() works
          2. When run from picard.exe, current_locale gets set to sv_SE.UTF-8 and locale.setlocale() crashes

          Hard coding this to sv_SE.UTF-8 also crashes it when run from source. Likewise hard coding sv_SE.cp1252 makes the picard.exe run.

          Now going to find out, why locale.getpreferredencoding() returns different values and what we can do about it.

          Philipp Wolfer added a comment - Some more debugging gave interesting results. Picard crashes when calling `locale.setlocale()` at  https://github.com/metabrainz/picard/blob/master/picard/i18n.py#L48 . The process just crashes, no exception or so to catch. Adding further logging shows a difference: When running Picard via tagger.py from source, current_locale gets set to sv_SE.cp1252 and locale.setlocale() works When run from picard.exe, current_locale gets set to sv_SE.UTF-8 and locale.setlocale() crashes Hard coding this to sv_SE.UTF-8 also crashes it when run from source. Likewise hard coding sv_SE.cp1252 makes the picard.exe run. Now going to find out, why locale.getpreferredencoding() returns different values and what we can do about it.

          Turns out the following line in Picard.ini triggers this:

          log_verbosity=10

          This is log level "debug". Setting this to something else, e.g. log_verbosity=30, works just fine.

          Philipp Wolfer added a comment - Turns out the following line in Picard.ini triggers this: log_verbosity=10 This is log level "debug". Setting this to something else, e.g. log_verbosity=30, works just fine.

            outsidecontext Philipp Wolfer
            outsidecontext Philipp Wolfer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1.3