-
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
-
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
-
@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!