Generated data getting lost when application terminates(pyinstaller bundle-path) #6074
Replies: 1 comment 2 replies
-
If you are symlinking a directory inside the temporary bundle directory, then the cleanup code jumps into linked directory and removes all its contents, due to: pyinstaller/bootloader/src/pyi_utils.c Lines 537 to 541 in f159ff9 The condition should probably be changed into
so that symlinked directories only have the link removed. That said, surely there are better ways of loading/writing your data (from/to a-priori known external location) in your application than symlinking the data directory into temporary bundle directory? And if not, you could remove the symlink yourself before your python code exits... |
Beta Was this translation helpful? Give feedback.
-
I am generating some images with a binary created using pyinstaller. Since at every run it creates a different bundle path in /tmp.
So I just a create a softlink inside it to map to the my data location. So all the images in the my data location is accessible using the softlink. But when the application terminates it deletes the run time bundle directory inside /tmp which has softlink to the my original data directory, but all the existing files in data directory gets deleted.
Deleting softlink should not delete the original files, so why it is happening?
Beta Was this translation helpful? Give feedback.
All reactions