From 4279c742890a6bb09ebb2a3597a7f4878f784507 Mon Sep 17 00:00:00 2001 From: Alex Tedeschi <60716244+AlexTedeschi@users.noreply.github.com> Date: Mon, 18 Apr 2022 16:23:50 -0400 Subject: [PATCH] Increase wait time of temporary file deletion Increase wait time to 4 seconds from 2 seconds for the deletion of the temporary file made from .show(). The Windows default image viewer at times can take longer than 2 seconds to open and display an image causing the image to never display for the user. --- src/PIL/ImageShow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/ImageShow.py b/src/PIL/ImageShow.py index 66f86211f..9117f57e5 100644 --- a/src/PIL/ImageShow.py +++ b/src/PIL/ImageShow.py @@ -141,7 +141,7 @@ class WindowsViewer(Viewer): def get_command(self, file, **options): return ( f'start "Pillow" /WAIT "{file}" ' - "&& ping -n 2 127.0.0.1 >NUL " + "&& ping -n 4 127.0.0.1 >NUL " f'&& del /f "{file}"' )