PendingDeprecationWarning:cgi.parse_qsl 已弃用,请使用 urlparse.parse_qsl 代替

发布于 2024-11-13 21:45:29 字数 1624 浏览 3 评论 0原文

警告消息:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是一片海 2024-11-20 21:45:30

来自文档

支持的平台

SQLAlchemy 已针对以下平台进行了测试:

  • cPython 自 2.4 版本起,一直到 2.xx 系列
  • cPython 版本 3,贯穿所有 3.xx 系列
  • Jython 2.5 或更高版本
  • Pypy 1.5 或更高版本

并非所有平台都具有 urlparse.parse_qsl()。如果您觉得这是一个问题,那么您应该向 SQLAlchemy 开发人员投诉。

From the docs:

Supported Platforms

SQLAlchemy has been tested against the following platforms:

  • cPython since version 2.4, through the 2.xx series
  • cPython version 3, throughout all 3.xx series
  • Jython 2.5 or greater
  • Pypy 1.5 or greater

Not all of those have urlparse.parse_qsl(). If you feel that this is a problem then you should complain to the SQLAlchemy developers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文