[ python-Bugs-1058960 ] install_lib fails under Python 2.1

SourceForge.net noreply at sourceforge.net
Sun Jan 30 00:49:18 CET 2005


Bugs item #1058960, was opened at 2004-11-02 18:57
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1058960&group_id=5470

Category: Distutils
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Geoffrey T. Dairiki (dairiki)
Assigned to: Nobody/Anonymous (nobody)
Summary: install_lib fails under Python 2.1

Initial Comment:
distutils/command/install_lib.py references os.extsep.
os.extsep is only available in pythons >= 2.2
(The result, naturally, is an uncaught AttributeError.)

Here's a quick patch (though the patch is flawed if
os.extsep is ever anything but '.' --- is it?)


----Begin Patch----
Index: cvs.2/distutils/command/install_lib.py
--- cvs.2/distutils/command/install_lib.py Mon, 25 Oct
2004 13:00:15 -0700 dairiki (distutils/b/43_install_li
1.1 644)
+++ cvs.2(w)/distutils/command/install_lib.py Tue, 02
Nov 2004 09:48:17 -0800 dairiki
(distutils/b/43_install_li 1.1 644)
@@ -9,7 +9,10 @@


 # Extension for Python source files.
-PYTHON_SOURCE_EXTENSION = os.extsep + "py"
+try:
+    PYTHON_SOURCE_EXTENSION = os.extsep + "py"
+except AttributeError:
+    PYTHON_SOURCE_EXTENSION = '.py'


 class install_lib (Command):
----End Patch----

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

>Comment By: Martin v. Löwis (loewis)
Date: 2005-01-30 00:49

Message:
Logged In: YES 
user_id=21627

Closing it as fixed. A backport to 2.3 would be pointless,
since 2.3 does have extsep. This change only matters
assuming there will be a separate distutils release some
day, which is doubtful.

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

Comment By: Paul Moore (pmoore)
Date: 2005-01-29 22:02

Message:
Logged In: YES 
user_id=113328

This has been fixed in CVS HEAD, and can be closed. It is
probably  a backport candidate to Python 2.4 (I can't check
if that has been done). It's likely too late for 2.3...

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

Comment By: Davide Alberani (alberanid)
Date: 2004-11-09 13:39

Message:
Logged In: YES 
user_id=170840

A somewhat simpler version:

  PYTHON_SOURCE_EXTENSION = getattr(os, 'extsep', '.') + "py"


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

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


More information about the Python-bugs-list mailing list