Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1290

pyside2-uic: warnings encoding in windows problem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P5: Not important
    • None
    • 5.14.1, 5.14.2
    • PySide
    • None
    • Windows 10 (russian locale), python 3.8.2, pyside2 5.14.2 from pip
    • Windows

    Description

      Example of error:

      pyside2-uic utf.ui > utf.py
      Traceback (most recent call last):
        File "c:\python382\lib\runpy.py", line 193, in _run_module_as_main
          return _run_code(code, main_globals, None,
        File "c:\python382\lib\runpy.py", line 86, in _run_code
          exec(code, run_globals)
        File "C:\python382\Scripts\pyside2-uic.exe\__main__.py", line 7, in <module>
        File "c:\python382\lib\site-packages\PySide2\scripts\pyside_tool.py", line 76, in uic
          qt_tool_wrapper("uic", ['-g', 'python'] + sys.argv[1:])
        File "c:\python382\lib\site-packages\PySide2\scripts\pyside_tool.py", line 70, in qt_tool_wrapper
          msg = err.decode("utf-8")
      UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 42: invalid continuation byte
      

      What is expected:

      pyside2-uic utf.ui > utf.py
      utf.ui: Warning: Buddy assignment: 'ั‚ะตัั‚' is not a valid widget.
      

      Tested on several windows10 machines. Linux has no errors.
      Expected result I got when I changed

      70 msg = err.decode("utf-8")
      

      to

      70 msg = err.decode("cp1251")
      

      in file PySide2\scripts\pyside_tool.py
      I think it's because Linux's default encoding is UTF-8, and Windows default encoding is cp1251.
      Bug works only with Cyrillic symbols. I even tried Japanese - it works without error.

      Attachments

        1. screenshot-1.png
          50 kB
          V D
        2. utf.ui
          1 kB
          V D
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            novd V D
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes