[Python-bugs-list] [ python-Bugs-686380 ] errors trying to get help on os attributes

SourceForge.net noreply@sourceforge.net
Fri, 14 Feb 2003 10:50:48 -0800


Bugs item #686380, was opened at 2003-02-13 23:11
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=686380&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: errors trying to get help on os attributes

Initial Comment:
I noticed some very weird behavior w/ 2.3 when asking for
help about some data attributes in the os module.  Consider:

% python
Python 2.3a1 (#13, Feb  4 2003, 09:26:29) 
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> help(os.sep)
no Python documentation found for '/'

>>> help(os.extsep)
problem in  - ValueError: Empty module name

>>> help(os.pathsep)
no Python documentation found for ':'

>>> help(os.curdir)
problem in  - ValueError: Empty module name

Now the same feat of prestidigation using 2.2.2 (on Mac OSX):

% python2.2 
Python 2.2.2 (#7, Oct 14 2002, 18:07:17) 
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> help(os.sep)
no Python documentation found for '/'

>>> help(os.extsep)
problem in  - ValueError: Empty module name

>>> help(os.pathsep)
no Python documentation found for ':'

>>> help(os.curdir)
problem in  - ValueError: Empty module name

Finally, the same example using 2.2.2 under Mandrake Linux:

% python
Python 2.2.2 (#1, Nov  8 2002, 08:50:21) 
[GCC 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> help(os.sep)
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
>>> help(os.extsep)
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
>>> help(os.pathsep)
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
>>> help(os.curdir)
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Now, I can understand that maybe I've hosed my CVS tree,
which would affect the 2.3 build, but the 2.2.2 build on both
Mac OS X and Mandrake Linux is I believe straight from the
source with no CVS monkey business.

Can anyone else reproduce this?

----------------------------------------------------------------------

Comment By: logistix (logistix)
Date: 2003-02-14 12:50

Message:
Logged In: YES 
user_id=699438

DOH! I'm an idiot.

You get the same value errors in Win32 in 2.2.2 and 2.3.1.  It 
looks it's the "locate" function in pydoc.  It tries to split a 
string by '.' in an attempt to resolve namespaces.  When you 
run that on a string like '.', '..', you get some empty strings 
and bad things happen.

I've got a patch that looks like it works.  It just uses a list 
comp to filter out null strings in the above situation.  I'll post it 
after running the test suite.

I don't know why Mandrake produced different results.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2003-02-14 11:26

Message:
Logged In: YES 
user_id=44345

I can understand the "no docstring" message, but that doesn't explain
the "problem in  - ValueError: Empty module name" error from help().
Also, the distinction I was trying to make between the 2.2.2 on Linux
and MacOSX was that on the former, the docstrings were consistent
(and what you'd expect for a string), while on the latter there were
two different responses, neither of which matched the response I
saw on Linux.

----------------------------------------------------------------------

Comment By: logistix (logistix)
Date: 2003-02-14 11:11

Message:
Logged In: YES 
user_id=699438

I think you're overthinking things.  A string instance won't 
have it's own specific docstring.

Python 2.3a1 (#38, Dec 31 2002, 17:53:59) [MSC v.1200 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import os
>>> help(os.sep)
no Python documentation found for '\'

>>> type(os.sep)
<type 'str'>
>>>

Maybe the versions you migrate into os.path should be 
functions (or will that break too much?)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=686380&group_id=5470