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

Fix OpenSSL issue #447

Merged
merged 2 commits into from
Jan 30, 2019
Merged

Conversation

ryanwilsonperkin
Copy link
Contributor

@ryanwilsonperkin ryanwilsonperkin commented Jan 29, 2019

Fixes #446

Using twine to push a package to a repository over HTTPS recently began resulting in the following stack trace:

Traceback (most recent call last):
  File "/usr/local/bin/twine", line 6, in <module>
    from twine.__main__ import main
  File "/usr/local/lib/python3.6/site-packages/twine/__main__.py", line 23, in <module>
    from twine.cli import dispatch
  File "/usr/local/lib/python3.6/site-packages/twine/cli.py", line 23, in <module>
    import requests_toolbelt
  File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/__init__.py", line 12, in <module>
    from .adapters import SSLAdapter, SourceAddressAdapter
  File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
    from .ssl import SSLAdapter
  File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
    from .._compat import poolmanager
  File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/_compat.py", line 59, in <module>
    from urllib3.contrib.pyopenssl import PyOpenSSLContext
  File "/usr/local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
ModuleNotFoundError: No module named 'OpenSSL'

A recent change to requests-toolbelt results in twine attempting to reference the pyopenssl library when it is not a requirement.

While this is being addressed (requests/toolbelt#241) in requests-toolbelt, we should pin twine to the last working version.

A [recent change](https://github.com/requests/toolbelt/compare/0.8.0..0.9.0) to
requests-toolbelt results in twine attempting to reference the pyopenssl
library when it is not a requirement.

While this is addressed in requests-toolbelt, we should pin twine to the last
working version.
@codecov
Copy link

codecov bot commented Jan 29, 2019

Codecov Report

Merging #447 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #447   +/-   ##
=======================================
  Coverage   79.94%   79.94%           
=======================================
  Files          14       14           
  Lines         748      748           
  Branches      108      108           
=======================================
  Hits          598      598           
  Misses        113      113           
  Partials       37       37

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81ee303...0ad3a16. Read the comment docs.

@ryanwilsonperkin
Copy link
Contributor Author

After some discussion in requests/toolbelt#241 and requests/toolbelt#242 now attempting a fix in requests-toolbelt in a new PR: requests/toolbelt#243

setup.py Outdated Show resolved Hide resolved
@sigmavirus24
Copy link
Member

0.9.1 was released which should fix this. We'd need to cut a new release to fix the version constraints. If you accept the suggestion in-line then we can cut a release that just blacklists 0.9.0 and ensures no one accidentally gets that version

Co-Authored-By: ryanwilsonperkin <[email protected]>
@ryanwilsonperkin
Copy link
Contributor Author

Thanks for the suggestion @sigmavirus24, applied your fix

@sigmavirus24 sigmavirus24 merged commit 61d01ac into pypa:master Jan 30, 2019
@ryanwilsonperkin ryanwilsonperkin deleted the fix-openssl-issue branch January 30, 2019 12:50
jonathanmeier5 added a commit to jonathanmeier5/compose-flow that referenced this pull request Feb 19, 2019
Due to a bad release of requests-toolbelt 0.9.0 discussed
here pypa/twine#447 twine was attempting
to refrence pyopenssl when it was not actually installed.

These upgrades fix the issue.
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

Successfully merging this pull request may close these issues.

3 participants