[ python-Bugs-1697215 ] Docstring for site.addpackage() is incorrect

SourceForge.net noreply at sourceforge.net
Sat May 19 20:10:27 CEST 2007


Bugs item #1697215, was opened at 2007-04-09 21:23
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1697215&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: cfk (carlfk)
Assigned to: Nobody/Anonymous (nobody)
Summary: Docstring for site.addpackage() is incorrect

Initial Comment:
docstring says "execute sitedir" - but that isn't what gets executed. 

suggested: 
    """Add a new path to known_paths by combining sitedir and 'name' 
or execute lines in name.pth that start with 'import'"""

site.py

def addpackage(sitedir, name, known_paths):

    """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'"""

    fullname = os.path.join(sitedir, name)
        f = open(fullname, "rU")
        for line in f:
            if line.startswith("import"):
                exec line
                                      

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

>Comment By: Georg Brandl (gbrandl)
Date: 2007-05-19 18:10

Message:
Logged In: YES 
user_id=849994
Originator: NO

Fixed in rev. 55455. (zseil, sorry, I didn't see your patch before
committing it...)

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

Comment By: Ziga Seilnacht (zseil)
Date: 2007-04-15 17:59

Message:
Logged In: YES 
user_id=1326842
Originator: NO

Here is a patch.  addpackage() is actually responsible
for .pth file processing, so the current docstring was
entirely incorrect.


File Added: addpackage_docstring.diff

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

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


More information about the Python-bugs-list mailing list