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

Consider replacing/forking ipify for Python 3.8 #143

Closed
braun1928 opened this issue Feb 11, 2020 · 3 comments · Fixed by #145
Closed

Consider replacing/forking ipify for Python 3.8 #143

braun1928 opened this issue Feb 11, 2020 · 3 comments · Fixed by #145

Comments

@braun1928
Copy link

rdegges/python-ipify hasn't been updated for some time, making onelogin-aws-cli fail in Python 3.8. There are PRs open, but nothing on the maintainer to approve/merge those changes.

Expected Behavior

Client works.

Current Behavior

$ /usr/local/opt/python@3.8/bin/python3 -m onelogin_aws_cli
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 184, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 143, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.8/site-packages/onelogin_aws_cli/__init__.py", line 13, in <module>
    import ipify
  File "/usr/local/lib/python3.8/site-packages/ipify/__init__.py", line 31, in <module>
    from .ipify import get_ip
  File "/usr/local/lib/python3.8/site-packages/ipify/ipify.py", line 14, in <module>
    from .settings import API_URI, MAX_TRIES, USER_AGENT
  File "/usr/local/lib/python3.8/site-packages/ipify/settings.py", line 9, in <module>
    from platform import mac_ver, win32_ver, linux_distribution, system
ImportError: cannot import name 'linux_distribution' from 'platform' (/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py)
@slycoder
Copy link
Contributor

Do you know of any good alternatives off-hand?

@braun1928
Copy link
Author

I don't know any packages with all the exception handling and stuff. The ipify.org site just shows how to use with requests, running a simple get('https://api.ipify.org').text (or to https://api.myip.com, or https://www.trackip.net/ip, ...).
None of them seem to need the correct user-agent to accept the request -- that's the reason ipify tries and fails to import.

@slycoder
Copy link
Contributor

Hey, sorry for not responding for a while. I'm no longer actively using onelogin so I've sadly ignored this repo for a while. That being said, if you wanna throw up a PR I'd be happy to take a look, merge it in, and push out a new release!

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 a pull request may close this issue.

2 participants