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

2009-01-16 Thread Mark Dickinson
On Thu, Jan 15, 2009 at 10:40 PM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 Right.  I've fixed the remainder, things should quiet down now.
 K

Thank you!
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Kristján Valur Jónsson
Ok, in r 68610 I fixed some of this.
The strftime test is now just an excercise, since clearly some platforms accept 
the %e without hesitation.
Also, there were errors in two test_os cases.

However, these:

==
ERROR: test_ftruncate (test.test_os.TestInvalidFD)
--
Traceback (most recent call last):
  File 
/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py, 
line 570, in test_ftruncate
self.assertRaises(OSError, os.ftruncate, 10, 0)
  File /home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py, 
line 345, in failUnlessRaises
callableObj(*args, **kwargs)
IOError: [Errno 9] Bad file descriptor

==
FAIL: test_close (test.test_os.TestInvalidFD)
--
Traceback (most recent call last):
  File 
/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py, 
line 542, in helper
self.assertRaises(OSError, getattr(os, f), 10)
AssertionError: OSError not raised

Seem bogus.
For ftruncate, an invalid filedescriptor really should return OSError, and 
close(10) should raise an OSError as well.

However, these are just being mapped up from whatever the OS returns, so I 
suppose I should make the tests more lenient?
K

-Original Message-
From: python-dev-bounces+kristjan=ccpgames@python.org 
[mailto:python-dev-bounces+kristjan=ccpgames@python.org] On Behalf Of 
Jean-Paul Calderone
Sent: 14. janúar 2009 20:20
To: python-dev@python.org
Subject: Re: [Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: 
test_datetime.py test_os.py

On Mon, 12 Jan 2009 19:09:28 +0100 (CET), kristjan.jonsson 
python-check...@python.org wrote:
Author: kristjan.jonsson
Date: Mon Jan 12 19:09:27 2009
New Revision: 68547

Log:
Add tests for invalid format specifiers in strftime, and for handling of 
invalid file descriptors in the os module.

Modified:
   python/trunk/Lib/test/test_datetime.py
   python/trunk/Lib/test/test_os.py

Several of the tests added to test_os.py are invalid and fail.

Jean-Paul
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/kristjan%40ccpgames.com

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Mark Dickinson
On Thu, Jan 15, 2009 at 9:13 AM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 However, these:

 ==
 ERROR: test_ftruncate (test.test_os.TestInvalidFD)
 --
 Traceback (most recent call last):
  File 
 /home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py, 
 line 570, in test_ftruncate
self.assertRaises(OSError, os.ftruncate, 10, 0)
  File 
 /home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py, line 
 345, in failUnlessRaises
callableObj(*args, **kwargs)
 IOError: [Errno 9] Bad file descriptor

At the risk of stating the obvious, shouldn't you be checking for
IOError rather than OSError in assertRaises?

Mark
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Kristján Valur Jónsson
Well, all the other functions raise OSError when the file descriptor is 
invalid.  IOError usually means that the IO itself failed.
I wonder if it is platform specific?  Does it raise IOError on all platforms?
I can also change the test to test for IOError or OSError.
K

-Original Message-
From: Mark Dickinson [mailto:dicki...@gmail.com] 
Sent: 15. janúar 2009 15:44
To: Kristján Valur Jónsson
Cc: Jean-Paul Calderone; python-dev@python.org
Subject: Re: [Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: 
test_datetime.py test_os.py

On Thu, Jan 15, 2009 at 9:13 AM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 However, these:

 ==
 ERROR: test_ftruncate (test.test_os.TestInvalidFD)
 --
 Traceback (most recent call last):
  File 
 /home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py, 
 line 570, in test_ftruncate
self.assertRaises(OSError, os.ftruncate, 10, 0)
  File 
 /home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py, line 
 345, in failUnlessRaises
callableObj(*args, **kwargs)
 IOError: [Errno 9] Bad file descriptor

At the risk of stating the obvious, shouldn't you be checking for
IOError rather than OSError in assertRaises?

Mark

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Mark Dickinson
On Thu, Jan 15, 2009 at 4:19 PM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 Well, all the other functions raise OSError when the file descriptor is 
 invalid.  IOError usually means that the IO itself failed.
 I wonder if it is platform specific?  Does it raise IOError on all platforms?

It certainly looks like it:  here are lines 6632--6638 of
posixmodule.c, in posix_ftruncate:

Py_BEGIN_ALLOW_THREADS
res = ftruncate(fd, length);
Py_END_ALLOW_THREADS
if (res  0) {
PyErr_SetFromErrno(PyExc_IOError);
return NULL;
}

Mark
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Mark Dickinson
On Thu, Jan 15, 2009 at 5:06 PM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 Interesting.
 Looks like a bug, really.  It's the only function that sets IOError.  All 
 others use posix_error which raises an OSError.

Maybe.  But changing it risks breaking existing code, so would certainly
require (at least) a tracker discussion.

In the meantime, please could you either revert or fix the r68547 checkin?
It looks as though *all* of the (non-Windows) trunk buildbots are failing on
test_os, and if any of the release managers notices we'll all be in
trouble.  :-)

Mark
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-15 Thread Kristján Valur Jónsson
Right.  I've fixed the remainder, things should quiet down now.
K

-Original Message-
From: Mark Dickinson [mailto:dicki...@gmail.com] 
Sent: 15. janúar 2009 20:40
To: Kristján Valur Jónsson
Cc: Jean-Paul Calderone; python-dev@python.org
Subject: Re: [Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: 
test_datetime.py test_os.py

On Thu, Jan 15, 2009 at 5:06 PM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
 Interesting.
 Looks like a bug, really.  It's the only function that sets IOError.  All 
 others use posix_error which raises an OSError.

Maybe.  But changing it risks breaking existing code, so would certainly
require (at least) a tracker discussion.

In the meantime, please could you either revert or fix the r68547 checkin?
It looks as though *all* of the (non-Windows) trunk buildbots are failing on
test_os, and if any of the release managers notices we'll all be in
trouble.  :-)

Mark

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2009-01-14 Thread Jean-Paul Calderone

On Mon, 12 Jan 2009 19:09:28 +0100 (CET), kristjan.jonsson 
python-check...@python.org wrote:

Author: kristjan.jonsson
Date: Mon Jan 12 19:09:27 2009
New Revision: 68547

Log:
Add tests for invalid format specifiers in strftime, and for handling of 
invalid file descriptors in the os module.

Modified:
  python/trunk/Lib/test/test_datetime.py
  python/trunk/Lib/test/test_os.py


Several of the tests added to test_os.py are invalid and fail.

Jean-Paul
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com