Author rbarran
Date 2005-10-31.12:54:01
SpamBayes Score
Marked as misclassified
Logged In: YES 


Thanks for all your comments; I'll amend my code & re-submit
a patch.
I've got a few questions for you:

I'm not sure it's worth checking that there's
a path.  I noticed that abspath() didn't have a similar
check.  I
didn't look for other places, but doubt there is much
error checking since a reasonable exception should be raised.

By adding this check on the input I wanted to avoid this
error message:

 >>> os.path.relpath('')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
"/usr/local/cvsrep/python/dist/src/Lib/", line
473, in relpath
     return os.path.join(*rel_list)
TypeError: join() takes at least 1 argument (0 given)

Which to me is obscure and forces you to dive into the
stdlib code to understand the real cause of the problem.
I'd noticed that the other functions in os.path don't seem
to check input, but usually a sensible default value can be
assumed (example, with abspath: if no argument is given it's
sensible to use the current dir instead).
So I'd like to keep the check on the input. However if you
feel that it's not needed I'll remove it.

I'd like to see test cases for the exceptions raised in

When writing this I tried to maintain a consistent style
with the other tests in the script which all
use the "tester" function. As far as I can tell, this
function doesn't allow testing of exceptions. 
I was tempted to use Unittest instead (as per the tests I
wrote for as it would allow testing of exceptions, but
decided to try and maintain consistency.
Do you think I should switch to using UnitTest instead?

Regards, Richard
Date User Action Args
2007-08-23 15:44:22adminlinkissue1339796 messages
2007-08-23 15:44:22admincreate