This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, dstufft, eric.araujo
Date 2015-02-09.21:06:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
With the following simple

$ cat
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('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Lib/distutils/", line 216, in run_setup
    exec(, 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

$ cat
from distutils.core import setup


run_setup runs, but clobbers sys.argv:

>>> from distutils.core import run_setup
>>> run_setup('', script_args=['--name'])
<distutils.dist.Distribution object at 0x101dddef0>
>>> import sys;sys.argv
['', '--name']
Date User Action Args
2015-02-09 21:06:45belopolskysetrecipients: + belopolsky, eric.araujo, dstufft
2015-02-09 21:06:45belopolskysetmessageid: <>
2015-02-09 21:06:45belopolskylinkissue23426 messages
2015-02-09 21:06:44belopolskycreate