[issue27728] HTTPConnection.requests has a mutable as default value for headers

2017-05-24 Thread Stéphane Wirtel
Changes by Stéphane Wirtel : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2017-05-24 Thread Stéphane Wirtel
Changes by Stéphane Wirtel : -- resolution: -> not a bug ___ Python tracker ___ ___

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread R. David Murray
R. David Murray added the comment: Yes, this is one of those cases where the benefit of the change is probably outweighed by the cost. -- ___ Python tracker

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread Martin Panter
Martin Panter added the comment: If the code does happen to mutate the dictionary, there would still be a bug with modifying any dictionary passed in by the caller. But I suspect there is no bug. So I am not sure the change is worth it. If we do go ahead, the documentation needs updating to

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread Stéphane Wirtel
Changes by Stéphane Wirtel : -- stage: -> patch review ___ Python tracker ___ ___

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thanks R.David.Murray, @SilentGhost in fact, in this code, it's not an issue but we use a bad practice and not a good practice with a mutable value. -- ___ Python tracker

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread R. David Murray
R. David Murray added the comment: Well, it's a problem in general because if the called routine modifies the default dict...the default is modified. I'm guessing it is never modified, but it is indeed better future proofing of the code to not use a mutable default in a routine that passes

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread SilentGhost
SilentGhost added the comment: Why is that an issue? -- nosy: +SilentGhost ___ Python tracker ___ ___

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread Stéphane Wirtel
New submission from Stéphane Wirtel: http.client.HTTPConnection.request, the argument 'headers' has a default value, and this one is a mutable (dict). -- messages: 272352 nosy: matrixise priority: normal severity: normal status: open title: HTTPConnection.requests has a mutable as

[issue27728] HTTPConnection.requests has a mutable as default value for headers

2016-08-10 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: here is my patch for that. -- keywords: +patch Added file: http://bugs.python.org/file44070/issue27728.diff ___ Python tracker