[Python-checkins] commit of r41602 - python/trunk/Lib/test/test_file.py

Guido van Rossum guido at python.org
Fri Dec 9 06:00:19 CET 2005


I think that defeats the purpose of the test; f.seek(-1) raises
IOError on a regular seekable file as well.

But in any case I'm not sure what the test is attempting to prove.
Since sys.stdin.seek(0) is not portable (works on OSX, doesn't work on
linux) the test can't be made portable so it's better to delete it
IMO...

--Guido

On 12/4/05, neal.norwitz <python-checkins at python.org> wrote:
> Author: neal.norwitz
> Date: Mon Dec  5 02:17:03 2005
> New Revision: 41602
>
> Modified:
>    python/trunk/Lib/test/test_file.py
> Log:
> Fix SF #1373161, r41552 broke test_file on OS X
>
> You apparently can seek(0) on sys.stdin on OS X.
> But you can't go backwards, so seek(-1).
>
>
>
> Modified: python/trunk/Lib/test/test_file.py
> ==============================================================================
> --- python/trunk/Lib/test/test_file.py  (original)
> +++ python/trunk/Lib/test/test_file.py  Mon Dec  5 02:17:03 2005
> @@ -101,7 +101,7 @@
>  f.close()
>
>  try:
> -    sys.stdin.seek(0)
> +    sys.stdin.seek(-1)
>  except IOError:
>      pass
>  else:
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list