When an attachment (e.g. PDF) is opened by double-clicking it and "Discard Changes" is pressed shortly afterwards, KeePass sometimes shows the error:
"The directory name is invalid"
In other cases, it reports an error related to the file name.
This seems to be related to how KeePass creates, opens, or cleans up the temporary file used to open the attachment.
Steps to reproduce:
1) Open an entry containing an attachment.
2) Double-click the attachment to open it.
3) Quickly select "Discard Changes".
4) An error may appear, sometimes referring to an invalid directory or file name.
Expected behavior:
KeePass should handle the temporary file cleanup gracefully, even if the attachment is discarded immediately after being opened, without displaying an error.
I can't reproduce this with a text file attachment.
What app are you using to view the PDF?
How are you persuading it to show the discard changes dialog? Are you changing anything?
cheers, Paul
I cannot reproduce this either.
In addition to what Paul wrote: could you please post a screenshot of the error message that you're seeing?
Thanks and best regards,
Dominik
@pail459 I'm using Sumatra PDF. I'm not editing anything.
@dreichl video should be better. Sumatra PDF is opening in another monitor, so I just recorded what I did with KeePass to reproduce the error message.
It's harder to reproduce the file name error message though.
Your video suggests the error arises on the second or subsequent opening of the attachment?
Try opening the file from the right click menu instead of editing the entry. (You should never edit an entry to use its data.)
cheers, Paul
Not really. You just have to be really fast
Great, thanks! I was able to reproduce the problem and have now improved the behavior in this case. It's not really possible to avoid such racing issues entirely (because KeePass doesn't know what the operating system and the external application are doing), but the error message in your videos is now much less likely to occur.
Here's the latest development snapshot for testing:
https://keepass.info/filepool/KeePass_260927.zip
Thanks and best regards,
Dominik