[New-bugs-announce] [issue23426] run_setup is broken in distutils

Alexander Belopolsky report at bugs.python.org
Mon Feb 9 22:06:45 CET 2015


New submission from Alexander Belopolsky:

With the following simple setup.py

$ cat setup.py
from distutils.core import setup
from distutils.command.install import install

class install1(install):
    sub_commands = install.sub_commamnds

setup(name='bug', cmdclass={'install': install1})


I get

>>> from distutils.core import run_setup
>>> run_setup('setup.py')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Lib/distutils/core.py", line 216, in run_setup
    exec(f.read(), g, l)
  File "<string>", line 4, in <module>
  File "<string>", line 5, in install1
NameError: name 'install' is not defined

Furthermore, on an even simpler setup.py:

$ cat setup1.py
from distutils.core import setup

setup(name='bug')

run_setup runs, but clobbers sys.argv:

>>> from distutils.core import run_setup
>>> run_setup('setup1.py', script_args=['--name'])
bug
<distutils.dist.Distribution object at 0x101dddef0>
>>> import sys;sys.argv
['setup1.py', '--name']

----------
components: Distutils
messages: 235632
nosy: belopolsky, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: run_setup is broken in distutils
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23426>
_______________________________________


More information about the New-bugs-announce mailing list