Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. ValueError: source code string cannot contain null bytes

ValueError: source code string cannot contain null bytes

Scheduled Pinned Locked Moved Unsolved Spanish
3 Posts 3 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt_Luis
    wrote on 16 Apr 2020, 22:24 last edited by
    #1

    El Qt 5.14.2 al instalar la version actual instala un Pyside2-uic que convierte los archivos *.py con una serie de candenas con bytes nulos esto lo experimente al convertir un archivo .ui que funcionaba y lo converti a python y me di la sorpresa que al comparar ambos archivos el nuevo era mas grande y no funcionaba me generaba el error del titulo ValueError: source code string cannot contain null bytes, por favor corregir la archivo PySide2-uic.exe

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Joel Bispo
      wrote on 21 Jul 2020, 11:08 last edited by
      #2

      This bug(?) only occurs when pyside2-uic is run in powershell and the output is redirected to a file.

      If using powershell use the -o option to specify an output file. Both methods work fine from a normal command prompt.

      pyside2-uic mainwindow.ui -o MainWindow.py
      

      instead of:

      pyside2-uic mainwindow.ui > MainWindow.py
      

      This works for me as you can see here on StackOverFlow: https://stackoverflow.com/questions/53035340/pyside2-uic-null-bytes-in-output

      N 1 Reply Last reply 31 May 2024, 16:16
      3
      • J Joel Bispo
        21 Jul 2020, 11:08

        This bug(?) only occurs when pyside2-uic is run in powershell and the output is redirected to a file.

        If using powershell use the -o option to specify an output file. Both methods work fine from a normal command prompt.

        pyside2-uic mainwindow.ui -o MainWindow.py
        

        instead of:

        pyside2-uic mainwindow.ui > MainWindow.py
        

        This works for me as you can see here on StackOverFlow: https://stackoverflow.com/questions/53035340/pyside2-uic-null-bytes-in-output

        N Offline
        N Offline
        NaveD
        wrote on 31 May 2024, 16:16 last edited by
        #3

        @Joel-Bispo OMG Thank you so much!!!

        I don't know if you will even see this comment after 4 years of you posting this but you are a GOD!!
        I spent half a day troubleshooting this error in my app with no luck! (Not even with the help of GPTs that we have these days)

        to anyone who still encounters this error, this solution also works with pyside6-uic

        again,
        Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved