PendingDeprecationWarning:cgi.parse_qsl 已弃用,请使用 urlparse.parse_qsl 代替
警告消息:
File "procesador.py", line 10, in <module>
from model import *
File "/Users/juque/Proyectos/est/patan/_patan/model.py", line 14, in <module>
b_engine = create_engine('mysql://root@localhost/intranet?charset=utf8&use_unicode=0', pool_recycle=3600, echo=False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/__init__.py", line 263, in create_engine
return strategy.create(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/strategies.py", line 48, in create
u = url.make_url(name_or_url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/url.py", line 171, in make_url
return _parse_rfc1738_args(name_or_url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/url.py", line 196, in _parse_rfc1738_args
query = (len(tokens) > 1 and dict(cgi.parse_qsl(tokens[1]))) or None
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", line 191, in parse_qsl
PendingDeprecationWarning, 2)
PendingDeprecationWarning: cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead
嗯,警告非常明确,但是如果假设我使用的是最新版本的 SQLAlchemy(0.7,稳定版和开发版)和 python 2.7,我不知道为什么会发生这种情况。
或者这是一个错误?
多谢。
warning message:
File "procesador.py", line 10, in <module>
from model import *
File "/Users/juque/Proyectos/est/patan/_patan/model.py", line 14, in <module>
b_engine = create_engine('mysql://root@localhost/intranet?charset=utf8&use_unicode=0', pool_recycle=3600, echo=False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/__init__.py", line 263, in create_engine
return strategy.create(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/strategies.py", line 48, in create
u = url.make_url(name_or_url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/url.py", line 171, in make_url
return _parse_rfc1738_args(name_or_url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLAlchemy-0.7.1dev-py2.7-macosx-10.5-fat3.egg/sqlalchemy/engine/url.py", line 196, in _parse_rfc1738_args
query = (len(tokens) > 1 and dict(cgi.parse_qsl(tokens[1]))) or None
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", line 191, in parse_qsl
PendingDeprecationWarning, 2)
PendingDeprecationWarning: cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead
Well, the warning is very clear, but i don't know why this happend if supposed I'm using the last version of SQLAlchemy (0.7, stable and dev) and python 2.7.
Or is this a Bug?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档:
并非所有平台都具有
urlparse.parse_qsl()
。如果您觉得这是一个问题,那么您应该向 SQLAlchemy 开发人员投诉。From the docs:
Not all of those have
urlparse.parse_qsl()
. If you feel that this is a problem then you should complain to the SQLAlchemy developers.