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

Handle import issue with urllib3 #377 #379

Merged
merged 1 commit into from
Jul 4, 2023
Merged

Handle import issue with urllib3 #377 #379

merged 1 commit into from
Jul 4, 2023

Conversation

jasonacox
Copy link
Owner

User @Frefdt reported import error in #377:

image

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the "ssl’ module is compiled with ‘OpenSSL 1.1.0h 27 Mar 2018". See: urllib3/urllib3#2168

TinyTuya uses the requests library which uses urllib3. It seems that v2 of urllib3 now requires OpenSSL 1.1.1 but some python environments only have OpenSSL 1.1.0. This PR updates the import requests of TinyTuya to gracefully handle this error.

try:
    import requests
except ImportError as impErr:
    print("WARN: Unable to import requests library, Cloud functions will not work.")
    print("WARN: Check dependencies. See https://github.com/jasonacox/tinytuya/issues/377")
    print("WARN: Error: {}.".format(impErr.args[0]))

@jasonacox jasonacox merged commit b329dd0 into master Jul 4, 2023
@jasonacox jasonacox deleted the urllib3 branch July 4, 2023 21:40
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.

1 participant