classification
Title: distutils: raise informative error message when cmd_class is None
Type: enhancement Stage: resolved
Components: Distutils2 Versions: 3rd party
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, rhettinger, srid, tarek
Priority: normal Keywords:

Created on 2010-07-19 16:35 by srid, last changed 2011-09-23 16:55 by eric.araujo. This issue is now closed.

Messages (3)
msg110776 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-07-19 16:35
Current I see this:

 File "/opt/ActivePython-2.7/lib/python2.7/distutils/dist.py", line 806, in get_command_class
   klass = self.cmdclass.get(command)
AttributeError: 'NoneType' object has no attribute 'get'

more context: https://bugs.launchpad.net/pyreadline/+bug/607329
msg131591 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-21 01:13
I’m inclined to reject the bug: http://docs.python.org/distutils/apiref#distutils.core.setup clearly says that the argument should be a dictionary.  The code in pyreadline should set it to an empty dict instead of None.  While it can be argued that providing clearly helpful messages is a service for our users, especially given that people writing setup scripts may be beginners, it seems to me that adding type checking would not be the Python way.  Raymond, what do you think?
msg144460 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-23 16:55
Given that it is documented that the argument must be a dictionary, I’m rejecting this.
History
Date User Action Args
2011-09-23 16:55:43eric.araujosetstatus: open -> closed
messages: + msg144460

assignee: tarek -> eric.araujo
resolution: wont fix
stage: resolved
2011-03-21 01:13:21eric.araujosetversions: + 3rd party, - Python 3.2
nosy: + rhettinger, alexis

messages: + msg131591

components: + Distutils2, - Distutils
2010-07-19 18:02:58eric.araujosetnosy: + eric.araujo

versions: - Python 2.7, Python 3.3
2010-07-19 16:35:20sridcreate