Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

Thanks for the report. It was made as a TypeError in 
https://bugs.python.org/issue19610#msg306853 in the commit to check for list 
explicitly [0] . Then since it broke a lot of packages as seen in the 
discussion and now it accepts string and list later at 
https://bugs.python.org/issue19610#msg307622 and commit [1] . 

I think Distribution doc was changed to reflect the change and setup doc had 
the old one indicating TypeError . So I guess it's a documentation fix that 
needs to be done. Using an integer for classifier gives me a warning and also 
eventually a TypeError on master and Python 3.7 . I am proposing this to be an 
easy doc fix. Would you like to raise a PR?

The doc is at 
https://github.com/python/cpython/blob/master/Doc/distutils/setupscript.rst


# Using classifier=1 in setup.py gives warning and then a TypeError. String is 
acceptable as per the original report

../cpython/python.exe setup.py sdist
Warning: 'classifiers' should be a list, got type 'int'
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    setup(name='foo',
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/distutils/core.py", 
line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/distutils/dist.py", 
line 267, in __init__
    getattr(self.metadata, "set_" + key)(val)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/distutils/dist.py", 
line 1215, in set_classifiers
    self.classifiers = _ensure_list(value, 'classifiers')
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/distutils/dist.py", 
line 40, in _ensure_list
    value = list(value)
TypeError: 'int' object is not iterable


[0] 
https://github.com/python/cpython/commit/dcaed6b2d954786eb5369ec2e8dfdeefe3cdc6ae#diff-d9afd486aff62306cb23cb8be2d4458eR1218

[1] 
https://github.com/python/cpython/commit/8837dd092fe5ad5184889104e8036811ed839f98#diff-d9afd486aff62306cb23cb8be2d4458eR30


Hope this helps!

----------
nosy: +xtreak

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35027>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to