Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twine check against a distribution with no description fails with AttributeError #411

Closed
asottile opened this issue Oct 7, 2018 · 1 comment

Comments

@asottile
Copy link
Contributor

asottile commented Oct 7, 2018

Your Environment

$ pip freeze --all
bleach==3.0.0
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
cmarkgfm==0.4.2
docutils==0.14
future==0.16.0
idna==2.7
pip==18.1
pkginfo==1.4.2
pycparser==2.19
Pygments==2.2.0
readme-renderer==22.0
requests==2.19.1
requests-toolbelt==0.8.0
setuptools==40.4.3
six==1.11.0
tqdm==4.26.0
twine==1.12.1
urllib3==1.23
webencodings==0.5.1
wheel==0.32.1

$ twine --version
twine version 1.12.1 (pkginfo: 1.4.2, requests: 2.19.1, setuptools: 40.4.3,
requests-toolbelt: 0.8.0, tqdm: 4.26.0)

$ python --version --version
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0]

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

Steps to Reproduce

If the issue is predictable and consistently reproducible, please list the steps here.

setup.py

from setuptools import setup

setup(name='foo', version='0.0.0')

reproduction

$ python setup.py sdist >& /dev/null
$ twine check dist/*
Checking distribution dist/foo-0.0.0.tar.gz: Traceback (most recent call last):
  File "/tmp/t/venv/bin/twine", line 11, in <module>
    sys.exit(main())
  File "/tmp/t/venv/lib/python3.6/site-packages/twine/__main__.py", line 28, in main
    return dispatch(sys.argv[1:])
  File "/tmp/t/venv/lib/python3.6/site-packages/twine/cli.py", line 75, in dispatch
    return main(args.args)
  File "/tmp/t/venv/lib/python3.6/site-packages/twine/commands/check.py", line 126, in main
    return check(args.dists)
  File "/tmp/t/venv/lib/python3.6/site-packages/twine/commands/check.py", line 97, in check
    metadata.get("description"), stream=stream, **parameters
  File "/tmp/t/venv/lib/python3.6/site-packages/readme_renderer/rst.py", line 95, in render
    parts = publish_parts(raw, writer=writer, settings_overrides=settings)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/core.py", line 450, in publish_parts
    enable_exit_status=enable_exit_status)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/core.py", line 664, in publish_programmatically
    output = pub.publish(enable_exit_status=enable_exit_status)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/readers/__init__.py", line 71, in read
    self.input = self.source.read()
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/io.py", line 435, in read
    return self.decode(self.source)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/io.py", line 99, in decode
    data_encoding = self.determine_encoding_from_data(data)
  File "/tmp/t/venv/lib/python3.6/site-packages/docutils/io.py", line 142, in determine_encoding_from_data
    if data.startswith(start_bytes):
AttributeError: 'NoneType' object has no attribute 'startswith'
@mithun
Copy link

mithun commented Oct 24, 2018

@sigmavirus24 Can you please release the changes from #412 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants