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

Picard fails to start on Windows if the hostname contains non-ASCII characters and browser integration is enabled

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.6.4
    • 2.6.3
    • None
    • OS: Windows 7 Professional N Service Pack 1

      I upgraded from Picard 2.5.6 to 2.6.3 and when starting Picard after the installation it shows a dialog window with the error message: "Failed to execute script tagger"

      Running Picard with -d, the debug log shows the following error:

      D: 11:45:31,409 tagger.main:1002: Looking for Qt locale de_DE in C:/Program Files/MusicBrainz Picard/PyQt5/Qt/translations
      Traceback (most recent call last):
      File "tagger.py", line 19, in <module>
      File "tagger.py", line 1009, in main
      File "tagger.py", line 395, in run
      File "browser\browser.py", line 111, in start
      File "socketserver.py", line 452, in _init_
      File "http\server.py", line 139, in server_bind
      File "socket.py", line 676, in getfqdn
      UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 1: invalid start byte

      Please find attached the debug log.

          [PICARD-2230] Picard fails to start on Windows if the hostname contains non-ASCII characters and browser integration is enabled

          We plan to do a 2.6.4 release with the crash fix. I have added PICARD-2276 to address fixing the functionality of browser integration if the hostname contains non-ASCII characters. This requires a Python update which we will do as part of the 2.7 release.

          Philipp Wolfer added a comment - We plan to do a 2.6.4 release with the crash fix. I have added PICARD-2276 to address fixing the functionality of browser integration if the hostname contains non-ASCII characters. This requires a Python update which we will do as part of the 2.7 release.

          Great this was a way for you to solve it. We will have this fixed in two ways in the next release:

          1. Next version will be built with Python 3.8.10, which fixes the core issue. That means browser integration will work as expected even with the "ü" in the hostname
          2. Picard will handle unexpected errors when setting up the browser integration. This will at least prevent Picard from crashing. E.g. when running with older Python in the case described here browser integration would not work, but at least Picard would start

          Both is already merged, so this will be definitely in Picard 2.7. I consider also doing a Picard 2.6.4 fixing at least the second case (I don't want to bump Python version in a point release). But let's see if we maybe get another thing to fix.

          Philipp Wolfer added a comment - Great this was a way for you to solve it. We will have this fixed in two ways in the next release: Next version will be built with Python 3.8.10, which fixes the core issue. That means browser integration will work as expected even with the "ü" in the hostname Picard will handle unexpected errors when setting up the browser integration. This will at least prevent Picard from crashing. E.g. when running with older Python in the case described here browser integration would not work, but at least Picard would start Both is already merged, so this will be definitely in Picard 2.7. I consider also doing a Picard 2.6.4 fixing at least the second case (I don't want to bump Python version in a point release). But let's see if we maybe get another thing to fix.

          GitHub Bot added a comment -

          See code changes in pull request #1841 submitted by phw.

          GitHub Bot added a comment - See code changes in pull request #1841 submitted by phw .

          XLChickenMan added a comment -

          Thanks for the quick reply!

          browser_integration_localhost_only was already true in my Picard.ini but setting browser_integration to false fixed the issue for me.

          Indeed, my computer's name contains a german umlaut ("ü") which caused the issue. When replacing the umlaut and setting browser_integration to true, the issue is also fixed.

          Thanks again for the quick help!

          XLChickenMan added a comment - Thanks for the quick reply! browser_integration_localhost_only was already true in my Picard.ini but setting browser_integration to false fixed the issue for me. Indeed, my computer's name contains a german umlaut ("ü") which caused the issue. When replacing the umlaut and setting browser_integration to true , the issue is also fixed. Thanks again for the quick help!

          The actual Python issue is https://bugs.python.org/issue26227

          This has been fixed in recent releases, the best solution hence would be to update Python. There is no fix for Python 3.7, but it has been fixed in Python 3.8.10 and Python 3.9.5.

          To maintain Windows 7 compatibility (which I'd like to do as long as there is a supported Python version with official Windows 7 support and no other urgent requirement forces us to drop Win 7 support) we need to stay with Python 3.8 series. Last time we tried to update that caused broken builds, so we need to fix getting working builds with Python 3.8 and later.

          Regardless of this we still must make Picard more error tolerant when trying to start the browser integration.

          Philipp Wolfer added a comment - The actual Python issue is https://bugs.python.org/issue26227 This has been fixed in recent releases, the best solution hence would be to update Python. There is no fix for Python 3.7, but it has been fixed in Python 3.8.10 and Python 3.9.5. To maintain Windows 7 compatibility (which I'd like to do as long as there is a supported Python version with official Windows 7 support and no other urgent requirement forces us to drop Win 7 support) we need to stay with Python 3.8 series. Last time we tried to update that caused broken builds, so we need to fix getting working builds with Python 3.8 and later. Regardless of this we still must make Picard more error tolerant when trying to start the browser integration.

          This is a issue with Python not being able to decode your computers hostname.

          A possible workaround for you would be to edit the Picard.init file and replace:

          browser_integration_localhost_only=false

          with

          browser_integration_localhost_only=true

          Afterwards I assume Picard should start. If not you probably need to completely disable the browser integration by changing

          browser_integration=true

          to

          browser_integration=false

          About the actual issue, could you check what windows reports as your computer's name and if it contains non ASCII characters? Changing that name to only ASCII characters could also help.

          Regarding the issue itself I think we cannot actually solve it in Picard, but once I know more details I'll report it to Python. But what we should do inside of Picard is handling this error and still allow Picard to successfully start, even if the browser integration throws an error like this.

          Philipp Wolfer added a comment - This is a issue with Python not being able to decode your computers hostname. A possible workaround for you would be to edit the Picard.init file and replace: browser_integration_localhost_only=false with browser_integration_localhost_only=true Afterwards I assume Picard should start. If not you probably need to completely disable the browser integration by changing browser_integration=true to browser_integration=false About the actual issue, could you check what windows reports as your computer's name and if it contains non ASCII characters? Changing that name to only ASCII characters could also help. Regarding the issue itself I think we cannot actually solve it in Picard, but once I know more details I'll report it to Python. But what we should do inside of Picard is handling this error and still allow Picard to successfully start, even if the browser integration throws an error like this.

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

              Created:
              Updated:

                Version Package
                2.6.4