mitsuhiko / flask-oauth

OAuth Support for Flask
http://flask.pocoo.org/
Other
582 stars 211 forks source link

urlparse library is urllib.parse in python3, urllib.quote is moved to urllib.parse #96

Open not-inept opened 6 years ago

not-inept commented 6 years ago

Hey there, when attempting to use this library on python 3.6.5 I encountered a few import errors. This was previously tracked and closed without being fixed in: https://github.com/mitsuhiko/flask-oauth/issues/85

I'd at least like a "won't fix/don't care" response if possible, it's unclear why the original issue was closed and it has received comments regularly since it was posted.

My hacky mitigation to import this library is:

import urllib.parse as urlparse
import sys
sys.modules["urlparse"] = urlparse
sys.modules["urllib"] = urlparse
from flask_oauth import OAuth

Errors on import:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/flask_oauth.py", line 13, in <module>
    from urlparse import urljoin
ModuleNotFoundError: No module named 'urlparse'

If I hack in urlparse, I then hit:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/flask_oauth.py", line 17, in <module>
    import oauth2
  File "/usr/local/lib/python3.6/site-packages/oauth2/__init__.py", line 33, in <module>
    from ._compat import PY3
  File "/usr/local/lib/python3.6/site-packages/oauth2/_compat.py", line 41, in <module>
    from urllib import quote
ImportError: cannot import name 'quote'
not-inept commented 6 years ago

I didn't notice the top of the readme, where this is marked as unmaintained:

Unmaintained
Flask-OAuth is currently unmaintained. If you want to add OAuth support to your Flask website, we recommend using Flask-Dance instead, which is actively maintained.

:(