Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. [PySide6] "pyside6-project.exe" has some bugs
QtWS25 Last Chance

[PySide6] "pyside6-project.exe" has some bugs

Scheduled Pinned Locked Moved Solved Qt for Python
6 Posts 2 Posters 732 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.
  • X Offline
    X Offline
    xliii
    wrote on 13 May 2023, 13:20 last edited by xliii
    #1

    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'

    J 1 Reply Last reply 13 May 2023, 13:31
    0
    • X xliii
      14 May 2023, 03:57

      @JonB QMLTYPEREGISTRAR_CMD is pyside6-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,
      35dc8f87-5b66-4de2-ab6d-2cdb90210ecb-image.png

      However, when I change nul to test.txt, it runs fine and a file named test.txt has created:
      6cbcf690-e573-4b18-93aa-e8b4539884b4-image.png

      At last, I found the system can not created a file name nul.txt in Windows 10:
      14718ebe-2d32-4cbe-b06a-8e3207779c17-image.png

      J Offline
      J Offline
      JonB
      wrote on 14 May 2023, 06:12 last edited by JonB
      #6

      @xliii
      For me nul is an acceptable null device and nul.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 that nul 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.

      1 Reply Last reply
      0
      • X xliii
        13 May 2023, 13:20

        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'

        J Offline
        J Offline
        JonB
        wrote on 13 May 2023, 13:31 last edited by JonB
        #2

        @xliii
        On your Windows 10, if you open a Command Prompt and try echo hello >nul what happens? Error? Creates a file named nul 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 checking nul works right for you.

        X 1 Reply Last reply 13 May 2023, 13:40
        0
        • J JonB
          13 May 2023, 13:31

          @xliii
          On your Windows 10, if you open a Command Prompt and try echo hello >nul what happens? Error? Creates a file named nul 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 checking nul works right for you.

          X Offline
          X Offline
          xliii
          wrote on 13 May 2023, 13:40 last edited by
          #3
          This post is deleted!
          J 1 Reply Last reply 13 May 2023, 13:48
          0
          • X xliii
            13 May 2023, 13:40

            This post is deleted!

            J Offline
            J Offline
            JonB
            wrote on 13 May 2023, 13:48 last edited by
            #4

            @xliii
            Yes, looks correct.

            Just for now if you change os.devnull in that line to something like "C:\\Temp\\dummy" (whatever suitable for your machine) does everything go through OK?

            X 1 Reply Last reply 14 May 2023, 03:57
            0
            • J JonB
              13 May 2023, 13:48

              @xliii
              Yes, looks correct.

              Just for now if you change os.devnull in that line to something like "C:\\Temp\\dummy" (whatever suitable for your machine) does everything go through OK?

              X Offline
              X Offline
              xliii
              wrote on 14 May 2023, 03:57 last edited by
              #5

              @JonB QMLTYPEREGISTRAR_CMD is pyside6-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,
              35dc8f87-5b66-4de2-ab6d-2cdb90210ecb-image.png

              However, when I change nul to test.txt, it runs fine and a file named test.txt has created:
              6cbcf690-e573-4b18-93aa-e8b4539884b4-image.png

              At last, I found the system can not created a file name nul.txt in Windows 10:
              14718ebe-2d32-4cbe-b06a-8e3207779c17-image.png

              J 1 Reply Last reply 14 May 2023, 06:12
              0
              • X xliii
                14 May 2023, 03:57

                @JonB QMLTYPEREGISTRAR_CMD is pyside6-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,
                35dc8f87-5b66-4de2-ab6d-2cdb90210ecb-image.png

                However, when I change nul to test.txt, it runs fine and a file named test.txt has created:
                6cbcf690-e573-4b18-93aa-e8b4539884b4-image.png

                At last, I found the system can not created a file name nul.txt in Windows 10:
                14718ebe-2d32-4cbe-b06a-8e3207779c17-image.png

                J Offline
                J Offline
                JonB
                wrote on 14 May 2023, 06:12 last edited by JonB
                #6

                @xliii
                For me nul is an acceptable null device and nul.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 that nul 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.

                1 Reply Last reply
                0
                • X xliii has marked this topic as solved on 16 May 2023, 00:58

                3/6

                13 May 2023, 13:40

                • Login

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