New submission from Vitaly Kruglikov <vitaly.k...@gmail.com>: ``` In [9]: from urllib.parse import urlencode, parse_qs
In [10]: import ast, ssl In [11]: d = dict(cert_reqs=ssl.CERT_NONE) In [12]: urlencode(d) Out[12]: 'cert_reqs=VerifyMode.CERT_NONE' In [25]: parse_qs('cert_reqs=VerifyMode.CERT_NONE') Out[25]: {'cert_reqs': ['VerifyMode.CERT_NONE']} In [29]: ast.literal_eval('VerifyMode.CERT_NONE') Traceback (most recent call last) ... ValueError: malformed node or string: <_ast.Attribute object at 0x105c22358> ``` This used to work fine and produce `'cert_reqs=0'` on Python 2.7, allowing it to be decoded properly downstream. However, `'cert_reqs=VerifyMode.CERT_NONE'` can't be decoded generically. So, something it's that used to work in prior python versions that is breaking now. Additional information. json.dumps() actually dumps that value as a number instead of 'VerifyMode.CERT_NONE'. It appears that urlencode doesn't work properly with enums, where I would expect it to emit the numeric value of the enum. ---------- assignee: christian.heimes components: Library (Lib), SSL messages: 313424 nosy: christian.heimes, vitaly.krug priority: normal severity: normal status: open title: urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders type: crash versions: Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33025> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com