[Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: test_datetime.pytest_os.py

Antoine Pitrou solipsis at pitrou.net
Thu Jan 15 13:00:22 CET 2009


Kristján Valur Jónsson <kristjan <at> ccpgames.com> writes:
> Seem bogus.
> For ftruncate, an invalid filedescriptor really should return OSError, and
close(10) should raise an
> OSError as well.

It seems wrong to assume that 10 is an invalid file descriptor at the time of
running the test.
IMO you should first open a file descriptor, remember its value and then close
it, that way you are reasonably sure that it will be invalid just after.

(I'm not saying this is why the tests are failing, but at least it would make
them more robust)




More information about the Python-Dev mailing list