Inelegant fail when TEMP folder is missing, having been set by an environment variable.

Bug #1622131 reported by Glenn Williams on 2016-09-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When having set the temp directory using the enviro-variable and for some reason, the set folder location is missing the app should give the option to switch back to a system default temp directory rather than just displaying the error pop-up and calibre closing

version 2.6.7 PC Win 10 rs1_release_inmarket 14393

This is not worth the effort for me personally. If some one else wants to implement it, I will be happy to supply any needed guidance. If so, re-open the ticket and we can discuss it.

 status wontfix

Changed in calibre:
status: New → Won't Fix
Eli Schwartz (eschwartz) wrote :

Shouldn't it be a simple matter of ensuring the folder exists before
trying to use it?

Alternatively, there doesn't need to be an option to fallback on the
system TMP directory -- just do it automatically.

Kovid Goyal (kovid) wrote :

It's not that simple, what if the environment var points to a directory on a drive that is not present? Or to a location for which calibre does not have write permissions?

calibre has fairly sophisticated logic to pick a temp dir that it knows will work, if the user chooses to explicitly override that logic, it is upto him to make sure it is a suitable location.

As for falling back to the system temp dir, to me having a program ignore my explicitly set temp dir and pick another temp dir would be incorrect/unexpected behavior. Instead when my setting is wrong the program should fail, giving me a chance to fix it. Imagine I was using the temp var for security purposes, silently ignoring it would then be a big fail.

Eli Schwartz (eschwartz) wrote :

Trying to create the directory as needed won't leave you any worse off if that too fails.

I see your point re: using the default though.

Kovid Goyal (kovid) wrote :

Same argument applies. Say I set the temp dir to a path on a mounted volume that is secured in some way or has some other special properties, say via mount flags. If the mount fails, this patch will cause calibre to create the temp dir on the underlying filesystem and happily use that with the user being none the wiser. If the underlying filesystem is an NFS share, you just exposed calibre temp files to the network.

Overriding an explicit user setting should be done with some form of user feedback, as the original bug report asked for.

Glenn Williams (glenn-williams) wrote :

i think my point here wasn't put across very well

I know its a tiny tiny issue.

one of the things I was trying to point out is that the error text shown in the pop-up isn't very friendly and is a little too 'programmer talk'. it was one of my parents who had the issue happen and they called me up having no idea what was wrong.

again I know its not massively important, I just thought it worth pointing out here.

and secondly as mentioned, just having the app close without giving the user more feedback is just a little inelegant.

I agree though, NEVER do a silent fail over. I'd absolutely never suggest that.

anyway guys, I'll take this chance to say hi to you all. Im really looking forward to getting more involved. I've written a few support apps and server stuff for calibre a year or so ago and i'm going to drop the code somewhere soon if any one is interested. Ive only just got the chance to start using calibre again after being kept away by work this last twelve months. (Sorry for using the bug post for this message)

cheers all

Kovid Goyal (kovid) wrote :

No problem, and hello to you too.

I'm curious, why had your parents set the env var at all, if, as you imply they are not very technically minded? Or was that a case of you setting it up for them (I do that for my parents all the time :)

I certainly have no problem with accepting patch to make the error message friendlier, since this error happens before the normal error handling routines are installed.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Won't Fix → Fix Released

You guessed it 😊

If im honest I mainly just wanted to post something to get involved, always good to make a start ay

Im looking forward to getting on-board

Sent from Mail for Windows 10

From: Kovid Goyal

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers