# Wrong error message from \`SaveScreenshot\` when save directory doesn't exist

**URL:** https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661
**Category:** ParaView Support
**Created:** [January 10, 2024, 4:21am UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661 "2024-01-10T04:21:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dutta-alankar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dutta-alankar/32/13310_2.png) [@dutta-alankar](https://discourse.paraview.org/u/dutta-alankar)
#### Post date: [January 10, 2024, 4:21am UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661/1 "2024-01-10T04:21:53Z")

</div>

When I use the following line in python trace, `pvpython` complains that it has run out of disk space when the directory passed doesn’t exist. This is a misleading error message and hopefully straightforward to fix. I don’t know if anyone else is also getting this. Just wanted to report it here for developers to take notice.

```auto
SaveScreenshot(f'{screenshot_loc}/screenshot-{file_no:04d}.png', layout1, SaveAllViews=1,
    ImageResolution=[1102, 664],
    FontScaling='Scale fonts proportionally',
    SeparatorWidth=1,
    SeparatorColor=[0.937, 0.922, 0.906],
    OverrideColorPalette='',
    StereoMode='No change',
    TransparentBackground=0, 
    # PNG options
    CompressionLevel='0',
    MetaData=['Application', 'ParaView'])

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 10, 2024, 5:46pm UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661/2 "2024-01-10T17:46:03Z")

</div>

Cc: @cory.quammen @mwestphal

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 11, 2024, 7:55am UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661/3 "2024-01-11T07:55:02Z")

</div>

Indeed, I reproduce. Could you open an issue @dutta-alankar ?

[https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

<div class="post-metadata">

### Author: ![dutta-alankar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dutta-alankar/32/13310_2.png) [@dutta-alankar](https://discourse.paraview.org/u/dutta-alankar)
#### Post date: [January 11, 2024, 8:02am UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661/4 "2024-01-11T08:02:47Z")

</div>

@mwestphal Done!

[paraview/paraview#22445](https://gitlab.kitware.com/paraview/paraview/-/issues/22445)

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 11, 2024, 9:39am UTC](https://discourse.paraview.org/t/wrong-error-message-from-savescreenshot-when-save-directory-doesnt-exist/13661/5 "2024-01-11T09:39:44Z")

</div>

The full message is the following:

vtkPNGWriter (0x5bc13f0e7bf0): Unable to open file /home/local/KHQ/spiros.tsalikis/Download/cantestTwo.png

ERROR: In vtkImageWriter.cxx, line 470  
vtkPNGWriter (0x5bc13f0e7bf0): Ran out of disk space; deleting file(s) already written

First it says that it can not open that file, and about the disk space, but i will see what i can do.
