[PySide6] "pyside6-project.exe" has some bugs
-
When build a python-qml project in qt creator, an error occurred:
Error: Error: Cannot open nul for writing Error while building/deploying project adding (kit: Desktop (x86-windows-msvc2019-pe-32bit)) When executing step "Run PySide6 project tool"
I have read the source code of PySide 6.5.0, found a bug:
in
\pyside-setup-everywhere-src-6.5\sources\pyside-tools\project.py
line 117:cmd = [QMLTYPEREGISTRAR_CMD, "--generate-qmltypes", os.fspath(qmltypes_file), "-o", os.devnull, os.fspath(file)]
as you known,
os.devnull = 'nul'
, this runs fine in Linux, but Windows 10 can not open a file named 'nul' -
@xliii
For menul
is an acceptable null device andnul.txt
is nothing special, can be created. I don't think you should assume that all Windows 10 cannot handle these --- it might be something about your Windows 10. Did it perchance come from an upgrade from Win 7? While searching yesterday I found someone saying thatnul
is a system device which can be "switched off" in Win 10, and they had seen that happen after an upgrade.- https://github.com/ipython/ipython/issues/9023
- https://answers.microsoft.com/en-us/windows/forum/all/device-is-suddenly-broken/34bbaa6b-11de-4fec-b440-7d974beee81c
- https://answers.microsoft.com/en-us/windows/forum/all/windows-10-device-not-working-devnull/358dd2bb-880a-420c-af6c-133ef79be9c5
- Registry
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Null
value (should be 1 not 4)?
Do you have access to a different Win 10 machine where you could test the
nul
stuff?Above you deleted an earlier response of yours, to which I had replied. Please don't do that, we lost the context. There was no reason to have deleted that reply.
-
@xliii
On your Windows 10, if you open a Command Prompt and tryecho hello >nul
what happens? Error? Creates a file namednul
in current directory? Or works? On my Win 11 it's fine.Not saying that whatever
QMLTYPEREGISTRAR_CMD
is it handles-o nul
correctly, but checkingnul
works right for you. -
@JonB
QMLTYPEREGISTRAR_CMD
ispyside6-qmltyperegistrar
, in my project,cmd = [QMLTYPEREGISTRAR_CMD, "--generate-qmltypes", os.fspath(qmltypes_file), "-o", os.devnull, os.fspath(file)]
interpreted as:D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\qmltyperegistrar --generate-qmltypes C:\Users\x\Desktop\pyside6_test\T02\test\test\main\bridge\Bridge.qmltypes -o nul C:\Users\x\Desktop\pyside6_test\T02\test\test\main\bridge\Bridgemetatypes.json --import-name test.main.bridge --major-version 1 --minor-version 0 --foreign-types=D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6core_metatypes.json --foreign-types=D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6core_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6gui_metatypes.json --foreign-types=D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6core_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6gui_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6qml_metatypes.json --foreign-types=D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6core_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6gui_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6qml_metatypes.json,D:\Miniconda3\envs\base_py39\Lib\site-packages\PySide6\metatypes\qt6widgets_metatypes.json
this cmd is wrong,
However, when I change
nul
totest.txt
, it runs fine and a file namedtest.txt
has created:
At last, I found the system can not created a file name
nul.txt
in Windows 10:
-
@xliii
For menul
is an acceptable null device andnul.txt
is nothing special, can be created. I don't think you should assume that all Windows 10 cannot handle these --- it might be something about your Windows 10. Did it perchance come from an upgrade from Win 7? While searching yesterday I found someone saying thatnul
is a system device which can be "switched off" in Win 10, and they had seen that happen after an upgrade.- https://github.com/ipython/ipython/issues/9023
- https://answers.microsoft.com/en-us/windows/forum/all/device-is-suddenly-broken/34bbaa6b-11de-4fec-b440-7d974beee81c
- https://answers.microsoft.com/en-us/windows/forum/all/windows-10-device-not-working-devnull/358dd2bb-880a-420c-af6c-133ef79be9c5
- Registry
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Null
value (should be 1 not 4)?
Do you have access to a different Win 10 machine where you could test the
nul
stuff?Above you deleted an earlier response of yours, to which I had replied. Please don't do that, we lost the context. There was no reason to have deleted that reply.
-