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

cqi.parse_qs was removed in Python 3.8 #580

Closed
hroncok opened this issue Jul 10, 2019 · 1 comment · Fixed by #581
Closed

cqi.parse_qs was removed in Python 3.8 #580

hroncok opened this issue Jul 10, 2019 · 1 comment · Fixed by #581

Comments

@hroncok
Copy link
Contributor

hroncok commented Jul 10, 2019

eventlet/tests/wsgi_test.py

Lines 317 to 321 in b9bf369

def test_007_get_arg(self):
# define a new handler that does a get_arg as well as a read_body
def new_app(env, start_response):
body = bytes_to_str(env['wsgi.input'].read())
a = cgi.parse_qs(body).get('a', [1])[0]

This fails on Python 3.8.0b2 with:

======================================================================
FAIL: test_007_get_arg (tests.wsgi_test.TestHttpd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/eventlet-0.25.0/tests/wsgi_test.py", line 338, in test_007_get_arg
    self.assertEqual(result.body, b'a is a, body is a=a')
AssertionError: b'Traceback (most recent call last):\n  Fil[489 chars]\'\n' != b'a is a, body is a=a'

----------------------------------------------------------------------
Ran 694 tests in 56.076s

FAILED (SKIP=95, failures=1)

And the traceback is:

Traceback (most recent call last):
  File "/builddir/build/BUILD/eventlet-0.25.0/eventlet/wsgi.py", line 566, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/builddir/build/BUILD/eventlet-0.25.0/tests/wsgi_test.py", line 113, in __call__
    return self.application(env, start_response)
  File "/builddir/build/BUILD/eventlet-0.25.0/tests/wsgi_test.py", line 321, in new_app
    a = cgi.parse_qs(body).get('a', [1])[0]
AttributeError: module 'cgi' has no attribute 'parse_qs'

See:

https://docs.python.org/3.7/library/cgi.html#cgi.parse_qs
This function is deprecated in this module. Use urllib.parse.parse_qs() instead. It is maintained here only for backward compatibility.

https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals
parse_qs, parse_qsl, and escape are removed from cgi module. They are deprecated from Python 3.2 or older.

@hroncok
Copy link
Contributor Author

hroncok commented Jul 10, 2019

#581

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.

1 participant