Version: PyAutoGUI 0.9.54
The screenshot function with the filename parameter does not save any file. I have tried using both relative and absolute paths, but the result is the same—no file is saved. There are no warnings or errors indicating a failure to save the screenshot.
However, when using the returned Pillow image object, the image can be saved successfully. The current workaround is to manually save the image using the returned object.
Here is a code example demonstrating the issue:
import os
import pyautogui
print(os.getcwd())
try:
im1 = pyautogui.screenshot('test.png') # Does not save anything
im1.save('test-from-pil.png') # Successfully saves the file
print("Screenshot saved successfully!")
except Exception as e:
print(f"Error: {e}")
Version: PyAutoGUI 0.9.54
The
screenshotfunction with thefilenameparameter does not save any file. I have tried using both relative and absolute paths, but the result is the same—no file is saved. There are no warnings or errors indicating a failure to save the screenshot.However, when using the returned Pillow image object, the image can be saved successfully. The current workaround is to manually save the image using the returned object.
Here is a code example demonstrating the issue: