Message51983
I agree the current behaviour is not ideal - but the right way forward isn't clear. Note the existing (strange) behaviour of os.path.join:
>>> os.path.join("c:\\", "\\a")
'c:\\a'
>>> os.path.join("c:\\foo", "\\a")
'\\a'
if isabs('\\a') returns False, there is almost an expectation that the last example should return 'c:\\foo\\a' - but that would almost never give what was expected. 'c:\\a' seems the correct result, but my quick scan of the test code in the patch shows this isn't exercised.
FWIW, about the only common use of isabs() in my code is something like:
log_directory = get_option_from_config_file(...)
if not os.path.isabs(log_directory):
# make log_directory absolute based on app directory.
log_directory = os.path.join(app_directory, log_directory)
Best I can tell, the above would not break if isabs('/foo') started returning False, so long as os.path.join('c:\\foo', '\\bar') resulted in 'c:\\bar'.
Off the top-of-my-head, another strategy may be to introduce isrelative() in 2.6, and in 2.7 introduce a warning when isabs() is passed one of the halfbreeds, warning that 2.8 will return a different value, and pointing to the new isrelative(). 2.8 then gets the full, 'correct' implementation as described here. |
|
Date |
User |
Action |
Args |
2007-08-23 15:56:47 | admin | link | issue1669539 messages |
2007-08-23 15:56:47 | admin | create | |
|