Nicolas Lehuen wrote:
2005/10/22, Jim Gallacher <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>:
Jim Gallacher wrote:
> Nicolas Lehuen wrote:
>
>> OK, I've added a unit test for req.send_file(fname) and everything
>> seems OK under Windows. Now if anyone want to write a test for the
>> symbolic link issue...
>
>
> Will do.
And done.
I've added the symlink unit test. It will only run if os.name
<http://os.name> ==
'posix'. Is that the correct way to do it wrt to skipping the test on
windows?
Also, is there any reason why os.remove(fname) is commented out in the
req_sendfile and req_sendfile2 tests? My /tmp directory gets purged on
reboot so it's not a big issue, but it may be an annoyance on some
systems.
Jim
1) I guess testing for posix is OK, at least it won't run on Windows.
Is there a better way? I'm open to suggestions.
2) I'm the one who commented this out since it was causing an exception
in the test on Windows (a problem with access rights IIRC).
I figured it was something like that.
I don't
think it's much of an annoyance since at least on my system there are a
lot of bad mannered programs who leave garbage in the temporary
directory, so a few kilobytes of mod_python test files won't matter.
I agree it's not a big issue. Just curious about the code.
Plus I think I've read that temporary files created by Python are
automatically deleted... I'll have to check that, though.
Only for TemporaryFile() and even then only for unix. mktemp and mkstemp
do not. Note that mktemp is deprecated in python 2.3 in favour of
mkstemp. I used mktemp however since I'm not sure if we have officially
dropped support for python < 2.3.
Regards,
Jim