reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Windows permission error removing .web directory

Open ElijahAhianyo opened this issue 2 years ago β€’ 0 comments

Describe the bug If the app fails before it gets to run, re-running the application throws the error:

Traceback (most recent call last):
  File "C:\Users\Clearspace User\Documents\Programming\openSource\pynecone\scripts\run.py", line 4, in <module>
    pc.init()
  File "C:\Users\Clearspace User\Documents\Programming\openSource\pynecone\pynecone\pc.py", line 36, in init
    utils.initialize_web_directory()
  File "C:\Users\Clearspace User\Documents\Programming\openSource\pynecone\pynecone\utils.py", line 415, in initialize_web_directory
    cp(constants.WEB_TEMPLATE_DIR, constants.WEB_DIR)
  File "C:\Users\Clearspace User\Documents\Programming\openSource\pynecone\pynecone\utils.py", line 208, in cp
    rm(dest)
  File "C:\Users\Clearspace User\Documents\Programming\openSource\pynecone\pynecone\utils.py", line 187, in rm
    shutil.rmtree(path)
  File "C:\Python311\Lib\shutil.py", line 758, in rmtree
    return _rmtree_unsafe(path, onerror)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\shutil.py", line 625, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Python311\Lib\shutil.py", line 623, in _rmtree_unsafe
    os.rmdir(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '.web'

It seems the process is still being hogged and there's no clear way to kill that process

** Specifics (please complete the following information):**

  • Python Version: 3.11.1
  • Pynecone Version: 0.1.14
  • OS: Windows
  • Browser (Optional):

ElijahAhianyo avatar Feb 13 '23 21:02 ElijahAhianyo