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

PySide6-deploy failed cleanup permission error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.2
    • 6.8.0.2
    • PySide
    • None
    • Windows
    • 6a3161e3f (dev), 9f0c176e9 (6.8)

    Description

      Pyside6-deploy creates an executable called "pyside_app_demo.exe" (instead of "window.exe" or "main.exe" depending on main entry point file name). I assume that it is the default project name, and it can be changed by initializing configuration file and then specifying appropriate name.

      It appears that pyside6-deploy has some trouble cleaning up after it's done. There is a permission error regarding an entry called "deployment". Apparently, it is a read-only directory, so it's not possible to remove it without enforcing this action (like using rm -rf).

      Here is a log of my actions:

      (.env) PS C:\Users\user\dev\python\gui\hello> pyside6-deploy main.py
      [DEPLOY] Executed file created in C:\Users\user\OneDrive\dev\python\gui\hello\pyside_app_demo.exe
      Traceback (most recent call last):
        File "C:\Users\user\.env\Lib\site-packages\PySide6\scripts\deploy.py", line 214, in <module>
          main(args.main_file, args.name, args.config_file, args.init, args.loglevel, args.dry_run,
        File "C:\Users\user\.env\Lib\site-packages\PySide6\scripts\deploy.py", line 169, in main
          cleanup(config=config)
        File "C:\Users\user\.env\Lib\site-packages\PySide6\scripts\deploy_lib\deploy_util.py", line 27, in cleanup
          shutil.rmtree(config.generated_files_path)
        File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\shutil.py", line 781, in rmtree
          return _rmtree_unsafe(path, onexc)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\shutil.py", line 629, in _rmtree_unsafe
          onexc(os.rmdir, fullname, err)
        File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\shutil.py", line 627, in _rmtree_unsafe
          os.rmdir(fullname)
      PermissionError: [WinError 5] Access is denied: 'C:\\Users\\user\\OneDrive\\dev\\python\\gui\\hello\\deployment\\main.build\\static_src'

      Here is how my directory looks like:

      (.env) PS C:\Users\user\dev\python\gui\hello> ls
          Directory: C:\Users\user\dev\python\gui\hello
      Mode                 LastWriteTime         Length Name
      ----                 -------------         ------ ----
      dar--l        12/18/2024  10:22 AM                deployment
      -a---l        12/17/2024  11:41 PM            400 main.py
      -a---l        12/18/2024  10:21 AM           2542 pysidedeploy.spec
      -a---l        12/18/2024  10:22 AM       25789440 pyside_app_demo.exe
      -a---l        12/17/2024  11:35 PM           2394 untitled.py
      -a---l        12/17/2024  11:33 PM           1193 untitled.ui 

      Note the "deployment" entry. It has a read-only flag and therefore cannot be removed. All subdirectories inside "deployment" are read-only as well.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shpremna Shyamnath Premnadh
            silentstranger Nikita Smirnov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes