473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Bad docs for os.path.isabs()

The docs for os.path.isabs() state:

isabs( path)

Return True if path is an absolute pathname (begins with a slash).

This is false becase os.path.isabs("C:\\foo") == True

It should read:

isabs( path)

Return True if path is an absolute pathname (begins with a slash or drive
letter).
Jul 18 '05 #1
3 2085
On Sun, 9 Nov 2003 11:32:46 -0800, "Ben Allfree" <be****@bldigital.com> wrote:
The docs for os.path.isabs() state:

isabs( path)

Return True if path is an absolute pathname (begins with a slash).

This is false becase os.path.isabs("C:\\foo") == True

It should read:

isabs( path)

Return True if path is an absolute pathname (begins with a slash or drive
letter).


While you're at it, better take this into account also ;-)
import os
os.path.isabs("C:\\foo") True os.path.isabs("C:foo") False os.path.isabs("\\foo")

True

For that last one, I think you could argue that it's false, since it does not
absolutely specify what the meaning is in a multi-drive system.

The whole drive letter file path thing is soo lame it makes me incoherent ;-/

Regards,
Bengt Richter
Jul 18 '05 #2
Ben Allfree wrote:

The docs for os.path.isabs() state:

isabs( path)

Return True if path is an absolute pathname (begins with a slash).

This is false becase os.path.isabs("C:\\foo") == True

It should read:

isabs( path)

Return True if path is an absolute pathname (begins with a slash or drive
letter).


As Bengt says, that revision is still insufficient/incorrect.

Probably the only way it can really be said is something like
"returns True if os.path.abspath() would leave the path unchanged".
(Or some variation on that... i.e. leave the actual specification
to the nuts-and-bolts of the platform-dependent code, rather than
trying to rewrite it in English and risk duplication/errors.)

-Peter
Jul 18 '05 #3
Frank Bechmann wrote:

IIRC (I currently have no DOS console at hand) even this is wrong:

"Return True if path is not relative to the current working
directory."

because the case "D:xyz" means a path relative to current path on
drive D: which is eventually not the same as the current working
directory.


You are correct, although the best thing for the world might be
if we all just pretended you weren't. :-)

-Peter
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben Allfree | last post by:
Written to normalize web server path names based on a virtual root. I propose that something equivalent to this be added to os.path ------------------------------------- import os.path import...
6
by: kimes | last post by:
I've just started digging into how python works.. I found that other mudules are clearly declared like one file per a module.. But the only os.path doesn't have their own file.. ye I know is...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: Andy Britcliffe | last post by:
Hi I'm faced with the situation where I could have a single physical file that could contain multiplie XML documents e.g file.txt contains the following: <?xml version="1.0"...
14
by: rurpy | last post by:
Another Python docs problem... I was trying to use imp.find_module(). >>> imp.find_module("mymod", "./subdir") ImportError: No frozen submodule named ./subdir.mymod subdir/mymod.py...
4
by: sysxperts | last post by:
Hi, I have a mail server that generates archives in a directory for every message sent or received and each archive has an associated XML file with <sender>, <receiver>, <subject> and other...
6
by: Michael Kintner | last post by:
I am looking for add-on tools or code to allow me to attach scanned PDF documents to a database record. I would like to know if there are developer tools out there that can do the following: -...
9
by: Giampaolo Rodola' | last post by:
Hi, I'm trying to solve a jython-related issue and I discovered a different behavior affecting os.path.isabs between CPython and Jython. C:\Python23>python.exe Python 2.3.5 (#62, Feb 8 2005,...
4
by: Mark Space | last post by:
Hi all, I'm looking for the docs on the php module. Ol' Apache says that the docs for LoadModule come from that module (PHP in this case) but unfortuanlely I can't find it. Is php5apache2_2.dll...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.