내가 플라스크 - 오픈 ID 작업을 얻으려고 노력하지만,이 기능문제 3
oid.try_login(openid, ask_for=['email', 'fullname', 'nickname'])
를 사용할 때 발생
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
에 로그인을 시도 할 때이 오류를 타격 유지하고있다
이 함수가 사용되는 곳이다 :
@app.route('/login', methods=['GET', 'POST'])
@oid.loginhandler
def login():
"""Does the login via OpenID. Has to call into `oid.try_login`
to start the OpenID machinery.
"""
# if we are already logged in, go back to were we came from
if g.user is not None:
app.logger.info('logged-in: ' + oid.get_next_url())
return redirect(oid.get_next_url())
if request.method == 'POST':
openid = request.form.get('openid_identifier')
if openid:
app.logger.info(request.form)
app.logger.info('logging-in: ' + oid.get_next_url())
return oid.try_login(openid, ask_for=['email', 'fullname',
'nickname'])
app.logger.info('not-logged-in: ' + oid.get_next_url())
return render_template('login.html', next=oid.get_next_url(),
error=oid.fetch_error())
을 실제로 플라스크 - 오픈 ID가 사용 LXML에 문제가 될 것으로 보인다 :
File "C:\Python33\lib\site-packages\openid\yadis\etxrd.py", line 69, in parseXRDS
element = ElementTree.XML(text)
File "lxml.etree.pyx", line 3012, in lxml.etree.XML (src\lxml\lxml.etree.c:67876)
File "parser.pxi", line 1781, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:102435)
저는 github에서 몇 가지 예제 프로젝트를 시도했지만 모두 동일한 문제가 있습니다. Flask-openid를 Python 3에서 사용할 수있는 방법이 있습니까?