[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2021-06-29 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2021-04-20 Thread Ethan Furman


Ethan Furman  added the comment:

Actually, I think it uses str().  An easy fix would be to use format() for all 
non-bytes objects instead -- the question then becomes how many objects 
(besides Enums with mixed-in data types) have a different str() vs format() 
display?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2021-04-20 Thread Christian Heimes


Christian Heimes  added the comment:

I guess so.

We turned CERT_NONE into an IntFlag enum many years ago. urlencode() uses repr 
to convert integer enums.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2021-04-20 Thread Ethan Furman


Ethan Furman  added the comment:

IIUC, the issue is that

  urlencode( {'cert_reqs': ssl.CERT_NONE} )

no longer produces

  'cert_reqs=0'

?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2021-04-17 Thread Christian Heimes


Change by Christian Heimes :


--
components:  -SSL
nosy:  -christian.heimes
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-13 Thread Christian Heimes

Christian Heimes  added the comment:

Ethan, please take a look.

--
assignee:  -> ethan.furman
nosy: +ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-08 Thread Christian Heimes

Change by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-07 Thread Vitaly Kruglikov

New submission from Vitaly Kruglikov :

```
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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com