CSSE1001 / MyPyTutor

Interactive tutorial application for Python3.
Other
7 stars 12 forks source link

Remove all tempfile download references #130

Closed sapi closed 9 years ago

sapi commented 9 years ago

On windows, downloading a zip file to $TMP will sporadically cause UAC to silently remove the file. It's a 'feature'.

Any time that .urlretrieve is used without a filename parameter, it defaults to downloading in $TMP. As a result, such downloads may fail on Windows.

Explicit filenames must therefore be given. It might be nice to download to our own temp-ish location using randomised filnames (GUIDs, maybe?)

sapi commented 9 years ago

@pjritee indicated in #121 that this issue is also prevalent on Ubuntu.

I might just switch all operating systems to put tempfiles in ~/.mptrc (via mkstemp(..., dir='~/.mptrc/tmp')) for more consistent performance.

pjritee commented 9 years ago

That seems like a good idea - this dir has to be created anyway so it may as well be used for tmp files. If you put the files there you probably don't even have to make it a tmp file - couldn't you just use the same name - e.g. MyPyTutor.zip - it won't conflict with the other files in this dir and it saves the hassle of renaming