[Distutils] problem compiling on SGI IRIX 6.5

Greg Ward gward@python.net
Thu, 17 Feb 2000 22:54:48 -0500

On 17 February 2000, Mona Wong said:
> 	I've just downloaded Distutils 0.1.3 and tried to compile it on my
> SGI IRIX 6.5 machine.  I am using python 1.5.1.

There are other known problems with Distutils on Python 1.5.1, so fixing 
this might just reveal other problems.  Nevertheless..

> proteus:/p12/src/Distutils-0.1.3) python setup.py install
> running install
> Traceback (innermost last):
>   File "setup.py", line 13, in ?
>     setup (name = "Distutils",
>   File "distutils/core.py", line 102, in setup
>     raise SystemExit, "error: %s: %s" % (exc.filename, exc.strerror)
> AttributeError: filename
> 	What is wrong and how do I fix this?

Oddly enough, the line *right* before where this exception was raised is 
the following:
            # is this 1.5.2-specific? 1.5-specific?

I think you may have answered my question: IOError objects only have
'filename' (and 'strerror'?) attributes since 1.5.2.  Grumble.

Here's a quick, dirty, completely-off-the-top-of-my-head patch that
might fix *this* problem.  If you fix whatever is causing the IOError,
though, you'll probably blow up on an 'apply()' somewhere where I pass a
list instead of a tuple, another 1.5.2 feature.  Grumble^2.

*** core.py.orig        Thu Feb 17 19:36:20 2000
--- core.py     Thu Feb 17 22:48:51 2000
*** 99,106 ****
          except KeyboardInterrupt:
              raise SystemExit, "interrupted"
          except IOError, exc:
!             # is this 1.5.2-specific? 1.5-specific?
!             raise SystemExit, "error: %s: %s" % (exc.filename, exc.strerror)
  # setup ()
--- 99,110 ----
          except KeyboardInterrupt:
              raise SystemExit, "interrupted"
          except IOError, exc:
!             # arg, try to work with Python pre-1.5.2
!             if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
!                 raise SystemExit, \
!                       "error: %s: %s" % (exc.filename, exc.strerror)
!             else:
!                 raise SystemExit, str (exc)
  # setup ()

Note that this patch is relative to the current CVS version, so it might 
not even apply.  Oh well, it's worth a shot.

Greg Ward - Linux weenie                                gward@python.net
Beware of altruism.  It is based on self-deception, the root of all evil.